From 7969a97789d2761adfad9c451f70c59a1b490131 Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Fri, 19 Jul 2024 20:03:39 -0500 Subject: [PATCH 1/2] added channel map v16 --- recoCrv.cpp | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/recoCrv.cpp b/recoCrv.cpp index f1ae0ae..128399f 100644 --- a/recoCrv.cpp +++ b/recoCrv.cpp @@ -78,7 +78,7 @@ class Calibration Calibration(); }; -Calibration::Calibration(const std::string &calibFileName, const int numberOfFebs, const int channelsPerFeb) : +Calibration::Calibration(const std::string &calibFileName, const int numberOfFebs, const int channelsPerFeb) : _numberOfFebs(numberOfFebs), _channelsPerFeb(channelsPerFeb), _newFormat(false) { std::ifstream calibFile; @@ -123,7 +123,7 @@ Calibration::Calibration(const std::string &calibFileName, const int numberOfFeb } for (int i=0; i>tmp; _calibrationFactor[i*_channelsPerFeb+j]=atof(tmp.c_str()); @@ -138,7 +138,7 @@ class CrvRecoEvent CrvRecoEvent(); public: - CrvRecoEvent(int signalRegionStart, int signalRegionEnd) : _f("peakfitter","[0]*(TMath::Exp(-(x-[1])/[2]-TMath::Exp(-(x-[1])/[2])))"), _signalRegionStart(signalRegionStart), _signalRegionEnd(signalRegionEnd) {Init();} + CrvRecoEvent(int signalRegionStart, int signalRegionEnd) : _f("peakfitter","[0]*(TMath::Exp(-(x-[1])/[2]-TMath::Exp(-(x-[1])/[2])))"), _signalRegionStart(signalRegionStart), _signalRegionEnd(signalRegionEnd) {Init();} void Init(); bool FailedFit(TFitResultPtr fr); void PeakFitter(const short* data, int numberOfSamples, float pedestal, float calibrationFactor, bool &draw); @@ -190,13 +190,13 @@ void CrvRecoEvent::PeakFitter(const short* data, int numberOfSamples, float pede std::vector > > peaks; //std::pair > //for peaks where two more more consecutive ADC values are equal //(e.g. if the max ADC value is reached) - //the beginning and end of these peak bins is indicated by + //the beginning and end of these peak bins is indicated by //peakbinsStart and peakbinsEnd. //the actual peak is probably in between this interval //(relevant for the seed value of the fit) int peakBinsStart=0; int peakBinsEnd=0; - for(int bin=_signalRegionStart; bin<=std::min(_signalRegionEnd,numberOfSamples); bin++) + for(int bin=_signalRegionStart; bin<=std::min(_signalRegionEnd,numberOfSamples); bin++) { waveform.push_back(data[bin]-pedestal); if(bin<=_signalRegionStart) continue; @@ -255,7 +255,7 @@ void CrvRecoEvent::PeakFitter(const short* data, int numberOfSamples, float pede //fill the graph float binWidth=1.0/RATE; TGraph g; - for(int bin=_recoStartBin[i]; bin<=_recoEndBin[i]; bin++) + for(int bin=_recoStartBin[i]; bin<=_recoEndBin[i]; bin++) { float t=bin*binWidth; float v=waveform[bin]; @@ -278,7 +278,7 @@ void CrvRecoEvent::PeakFitter(const short* data, int numberOfSamples, float pede _PEs[i] = waveform[peakBinsStart]*TMath::E()*DEFAULT_BETA/calibrationFactor; //using maximum ADC value of this pulse and a typical value of beta _pulseHeight[i] = waveform[peakBinsStart]; _time[i] = averagePeakBin*binWidth; - _beta[i] = DEFAULT_BETA; + _beta[i] = DEFAULT_BETA; _LEtime[i] = _time[i]-0.985*DEFAULT_BETA; //time-0.985*beta for 50% pulse height _fitStatus[i] = 2; draw = false; @@ -322,7 +322,7 @@ class CrvEvent TTree *tree, TTree *recoTree, const TemperatureCorrections &temperatureCorrections, float PEcut); void Reconstruct(int entry, const Calibration &calib); TCanvas *GetCanvas(int feb, int channel) {return _canvas[feb*_channelsPerFeb+channel];} - TH1F *GetHistPEs(int i, int feb, int channel) + TH1F *GetHistPEs(int i, int feb, int channel) { return (i==0?_histPEs[feb*_channelsPerFeb+channel]:_histPEsTemperatureCorrected[feb*_channelsPerFeb+channel]); } @@ -344,7 +344,7 @@ class CrvEvent int _numberOfFebs; int _channelsPerFeb; int _numberOfSamples; - + TTree *_tree; TTree *_recoTree; @@ -584,7 +584,7 @@ if(entry%1000==0) std::cout<<"R "<-300 && temperatureFEB>-300) //temperature of -1000 means no temperature found + if(fabs(_temperature[index])<100 && fabs(temperatureFEB)<100) //temperature of -1000 means no temperature found { //overvoltage difference for actual CMB and FEB temperatures w.r.t. reference CMB and FEB temperatures //deltaOvervoltage = overvoltageTemperatureChangeCMB*(TCMB-TrefCMB) + overvoltageTemperatureChangeFEB*(TFEB-TrefFEB) @@ -767,7 +767,7 @@ void CrvEvent::TrackFit() void CrvEvent::ReadChannelMap(const std::string &channelMapFile) { std::ifstream file(channelMapFile); - if(!file.is_open()) {std::cerr<<"Channel map file could not be opened."<GetBranch("spill_boardStatus")) return; //older file: board status was not stored @@ -964,7 +964,7 @@ void BoardRegisters(TTree *treeSpills, std::ofstream &txtFile, const int numberO bool foundFeb[numberOfFebs]={false}; for(int feb=0; feb channels) } return sequence; } -void Summarize(const std::string &pdfFileName, const std::string &txtFileName, const int numberOfFebs, const int channelsPerFeb, +void Summarize(const std::string &pdfFileName, const std::string &txtFileName, const int numberOfFebs, const int channelsPerFeb, const std::vector mpvs[2], const std::vector fwhms[2], const TemperatureCorrections &tc) { std::ifstream settingsFile; @@ -1426,7 +1426,7 @@ void process(const std::string &runNumber, const std::string &inFileName, const recoFile.mkdir("plots"); TTree *recoTree = new TTree("run","run"); TTree *recoTreeSpill = treeSpills->CloneTree(); - + int numberOfFebs; int channelsPerFeb; int numberOfSamples; @@ -1435,7 +1435,7 @@ void process(const std::string &runNumber, const std::string &inFileName, const treeSpills->SetBranchAddress("spill_number_of_samples", &numberOfSamples); treeSpills->GetEntry(0); //to read the numberOfFebs, channelsPerFeb, and numberOfSamples - Calibration calib(calibFileName, numberOfFebs, channelsPerFeb); + Calibration calib(calibFileName, numberOfFebs, channelsPerFeb); CrvEvent event(runNumber, numberOfFebs, channelsPerFeb, numberOfSamples, tree, recoTree, tc, PEcut); if(channelMapFile!="") event.ReadChannelMap(channelMapFile); @@ -1497,7 +1497,7 @@ void process(const std::string &runNumber, const std::string &inFileName, const t[i]->AddText(Form("Chi2/Ndf: %.3f",chi2)); t[i]->AddText(Form("maxed out: %.3f",maxedOutFraction.back())); t[i]->Draw("same"); - } + } event.GetCanvas(feb, channel)->cd(2); TPaveText tt(0.48,0.72,0.88,0.88,"NDC"); @@ -1594,7 +1594,7 @@ void makeFileNames(const std::string &runNumber, std::string &inFileName, std::s dirFile.close(); bool found=false; - for(const auto& dirEntry : std::experimental::filesystem::directory_iterator(crvDirName)) + for(const auto& dirEntry : std::experimental::filesystem::directory_iterator(crvDirName)) { const std::string s = dirEntry.path().filename().string(); const std::string s0 = "crv.parsed."; @@ -1615,7 +1615,7 @@ void makeFileNames(const std::string &runNumber, std::string &inFileName, std::s if(!found) { //try Ray's version of file names - for(const auto& dirEntry : std::experimental::filesystem::directory_iterator(crvDirName)) + for(const auto& dirEntry : std::experimental::filesystem::directory_iterator(crvDirName)) { const std::string s = dirEntry.path().filename().string(); const std::string s0 = "ntd.mu2e."; From c30605169c8e9e16b9969c1caa05bf65f85ff784 Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Fri, 19 Jul 2024 20:04:10 -0500 Subject: [PATCH 2/2] added channel map v16 --- eventdisplay/channelMapCrvAging016.txt | 257 +++++++++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 eventdisplay/channelMapCrvAging016.txt diff --git a/eventdisplay/channelMapCrvAging016.txt b/eventdisplay/channelMapCrvAging016.txt new file mode 100644 index 0000000..80ba065 --- /dev/null +++ b/eventdisplay/channelMapCrvAging016.txt @@ -0,0 +1,257 @@ +febA chA_1 chA_2 febB chB_1 chB_2 x y +0 0 1 4 0 1 0 0 +0 2 3 4 2 3 51.3875 0 +0 4 5 4 4 5 103.1875 0 +0 6 7 4 6 7 154.575 0 +0 8 9 4 8 9 206.375 0 +0 10 11 4 10 11 257.7625 0 +0 12 13 4 12 13 309.5625 0 +0 14 15 4 14 15 360.95 0 +0 16 17 4 16 17 412.75 0 +0 18 19 4 18 19 464.1375 0 +0 20 21 4 20 21 515.9375 0 +0 22 23 4 22 23 567.325 0 +0 24 25 4 24 25 619.125 0 +0 26 27 4 26 27 670.5125 0 +0 28 29 4 28 29 722.3125 0 +0 30 31 4 30 31 773.7 0 +0 32 33 4 32 33 42 -29.325 +0 34 35 4 34 35 93.3875 -29.325 +0 36 37 4 36 37 145.1875 -29.325 +0 38 39 4 38 39 196.575 -29.325 +0 40 41 4 40 41 248.375 -29.325 +0 42 43 4 42 43 299.7625 -29.325 +0 44 45 4 44 45 351.5625 -29.325 +0 46 47 4 46 47 402.95 -29.325 +0 48 49 4 48 49 454.75 -29.325 +0 50 51 4 50 51 506.1375 -29.325 +0 52 53 4 52 53 557.9375 -29.325 +0 54 55 4 54 55 609.325 -29.325 +0 56 57 4 56 57 661.125 -29.325 +0 58 59 4 58 59 712.5125 -29.325 +0 60 61 4 60 61 764.3125 -29.325 +0 62 63 4 62 63 815.7 -29.325 +1 0 1 5 0 1 84 -58.65 +1 2 3 5 2 3 135.3875 -58.65 +1 4 5 5 4 5 187.1875 -58.65 +1 6 7 5 6 7 238.575 -58.65 +1 8 9 5 8 9 290.375 -58.65 +1 10 11 5 10 11 341.7625 -58.65 +1 12 13 5 12 13 393.5625 -58.65 +1 14 15 5 14 15 444.95 -58.65 +1 16 17 5 16 17 496.75 -58.65 +1 18 19 5 18 19 548.1375 -58.65 +1 20 21 5 20 21 599.9375 -58.65 +1 22 23 5 22 23 651.325 -58.65 +1 24 25 5 24 25 703.125 -58.65 +1 26 27 5 26 27 754.5125 -58.65 +1 28 29 5 28 29 806.3125 -58.65 +1 30 31 5 30 31 857.7 -58.65 +1 32 33 5 32 33 126 -87.975 +1 34 35 5 34 35 177.3875 -87.975 +1 36 37 5 36 37 229.1875 -87.975 +1 38 39 5 38 39 280.575 -87.975 +1 40 41 5 40 41 332.375 -87.975 +1 42 43 5 42 43 383.7625 -87.975 +1 44 45 5 44 45 435.5625 -87.975 +1 46 47 5 46 47 486.95 -87.975 +1 48 49 5 48 49 538.75 -87.975 +1 50 51 5 50 51 590.1375 -87.975 +1 52 53 5 52 53 641.9375 -87.975 +1 54 55 5 54 55 693.325 -87.975 +1 56 57 5 56 57 745.125 -87.975 +1 58 59 5 58 59 796.5125 -87.975 +1 60 61 5 60 61 848.3125 -87.975 +1 62 63 5 62 63 899.7 -87.975 +2 0 1 6 0 1 0 -225.25 +2 2 3 6 2 3 51.3875 -225.25 +2 4 5 6 4 5 103.1875 -225.25 +2 6 7 6 6 7 154.575 -225.25 +2 8 9 6 8 9 206.375 -225.25 +2 10 11 6 10 11 257.7625 -225.25 +2 12 13 6 12 13 309.5625 -225.25 +2 14 15 6 14 15 360.95 -225.25 +2 16 17 6 16 17 412.75 -225.25 +2 18 19 6 18 19 464.1375 -225.25 +2 20 21 6 20 21 515.9375 -225.25 +2 22 23 6 22 23 567.325 -225.25 +2 24 25 6 24 25 619.125 -225.25 +2 26 27 6 26 27 670.5125 -225.25 +2 28 29 6 28 29 722.3125 -225.25 +2 30 31 6 30 31 773.7 -225.25 +2 32 33 6 32 33 42 -254.575 +2 34 35 6 34 35 93.3875 -254.575 +2 36 37 6 36 37 145.1875 -254.575 +2 38 39 6 38 39 196.575 -254.575 +2 40 41 6 40 41 248.375 -254.575 +2 42 43 6 42 43 299.7625 -254.575 +2 44 45 6 44 45 351.5625 -254.575 +2 46 47 6 46 47 402.95 -254.575 +2 48 49 6 48 49 454.75 -254.575 +2 50 51 6 50 51 506.1375 -254.575 +2 52 53 6 52 53 557.9375 -254.575 +2 54 55 6 54 55 609.325 -254.575 +2 56 57 6 56 57 661.125 -254.575 +2 58 59 6 58 59 712.5125 -254.575 +2 60 61 6 60 61 764.3125 -254.575 +2 62 63 6 62 63 815.7 -254.575 +3 0 1 7 0 1 84 -283.9 +3 2 3 7 2 3 135.3875 -283.9 +3 4 5 7 4 5 187.1875 -283.9 +3 6 7 7 6 7 238.575 -283.9 +3 8 9 7 8 9 290.375 -283.9 +3 10 11 7 10 11 341.7625 -283.9 +3 12 13 7 12 13 393.5625 -283.9 +3 14 15 7 14 15 444.95 -283.9 +3 16 17 7 16 17 496.75 -283.9 +3 18 19 7 18 19 548.1375 -283.9 +3 20 21 7 20 21 599.9375 -283.9 +3 22 23 7 22 23 651.325 -283.9 +3 24 25 7 24 25 703.125 -283.9 +3 26 27 7 26 27 754.5125 -283.9 +3 28 29 7 28 29 806.3125 -283.9 +3 30 31 7 30 31 857.7 -283.9 +3 32 33 7 32 33 126 -313.225 +3 34 35 7 34 35 177.3875 -313.225 +3 36 37 7 36 37 229.1875 -313.225 +3 38 39 7 38 39 280.575 -313.225 +3 40 41 7 40 41 332.375 -313.225 +3 42 43 7 42 43 383.7625 -313.225 +3 44 45 7 44 45 435.5625 -313.225 +3 46 47 7 46 47 486.95 -313.225 +3 48 49 7 48 49 538.75 -313.225 +3 50 51 7 50 51 590.1375 -313.225 +3 52 53 7 52 53 641.9375 -313.225 +3 54 55 7 54 55 693.325 -313.225 +3 56 57 7 56 57 745.125 -313.225 +3 58 59 7 58 59 796.5125 -313.225 +3 60 61 7 60 61 848.3125 -313.225 +3 62 63 7 62 63 899.7 -313.225 +-1 0 1 -5 0 1 0 -450.5 +-1 2 3 -5 2 3 51.3875 -450.5 +-1 4 5 -5 4 5 103.1875 -450.5 +-1 6 7 -5 6 7 154.575 -450.5 +-1 8 9 -5 8 9 206.375 -450.5 +-1 10 11 -5 10 11 257.7625 -450.5 +-1 12 13 -5 12 13 309.5625 -450.5 +-1 14 15 -5 14 15 360.95 -450.5 +-1 16 17 -5 16 17 412.75 -450.5 +-1 18 19 -5 18 19 464.1375 -450.5 +-1 20 21 -5 20 21 515.9375 -450.5 +-1 22 23 -5 22 23 567.325 -450.5 +-1 24 25 -5 24 25 619.125 -450.5 +-1 26 27 -5 26 27 670.5125 -450.5 +-1 28 29 -5 28 29 722.3125 -450.5 +-1 30 31 -5 30 31 773.7 -450.5 +-1 32 33 -5 32 33 42 -479.825 +-1 34 35 -5 34 35 93.3875 -479.825 +-1 36 37 -5 36 37 145.1875 -479.825 +-1 38 39 -5 38 39 196.575 -479.825 +-1 40 41 -5 40 41 248.375 -479.825 +-1 42 43 -5 42 43 299.7625 -479.825 +-1 44 45 -5 44 45 351.5625 -479.825 +-1 46 47 -5 46 47 402.95 -479.825 +-1 48 49 -5 48 49 454.75 -479.825 +-1 50 51 -5 50 51 506.1375 -479.825 +-1 52 53 -5 52 53 557.9375 -479.825 +-1 54 55 -5 54 55 609.325 -479.825 +-1 56 57 -5 56 57 661.125 -479.825 +-1 58 59 -5 58 59 712.5125 -479.825 +-1 60 61 -5 60 61 764.3125 -479.825 +-1 62 63 -5 62 63 815.7 -479.825 +-2 0 1 -6 0 1 84 -509.15 +-2 2 3 -6 2 3 135.3875 -509.15 +-2 4 5 -6 4 5 187.1875 -509.15 +-2 6 7 -6 6 7 238.575 -509.15 +-2 8 9 -6 8 9 290.375 -509.15 +-2 10 11 -6 10 11 341.7625 -509.15 +-2 12 13 -6 12 13 393.5625 -509.15 +-2 14 15 -6 14 15 444.95 -509.15 +-2 16 17 -6 16 17 496.75 -509.15 +-2 18 19 -6 18 19 548.1375 -509.15 +-2 20 21 -6 20 21 599.9375 -509.15 +-2 22 23 -6 22 23 651.325 -509.15 +-2 24 25 -6 24 25 703.125 -509.15 +-2 26 27 -6 26 27 754.5125 -509.15 +-2 28 29 -6 28 29 806.3125 -509.15 +-2 30 31 -6 30 31 857.7 -509.15 +-2 32 33 -6 32 33 126 -538.475 +-2 34 35 -6 34 35 177.3875 -538.475 +-2 36 37 -6 36 37 229.1875 -538.475 +-2 38 39 -6 38 39 280.575 -538.475 +-2 40 41 -6 40 41 332.375 -538.475 +-2 42 43 -6 42 43 383.7625 -538.475 +-2 44 45 -6 44 45 435.5625 -538.475 +-2 46 47 -6 46 47 486.95 -538.475 +-2 48 49 -6 48 49 538.75 -538.475 +-2 50 51 -6 50 51 590.1375 -538.475 +-2 52 53 -6 52 53 641.9375 -538.475 +-2 54 55 -6 54 55 693.325 -538.475 +-2 56 57 -6 56 57 745.125 -538.475 +-2 58 59 -6 58 59 796.5125 -538.475 +-2 60 61 -6 60 61 848.3125 -538.475 +-2 62 63 -6 62 63 899.7 -538.475 +-3 0 1 -7 0 1 0 -675.75 +-3 2 3 -7 2 3 51.3875 -675.75 +-3 4 5 -7 4 5 103.1875 -675.75 +-3 6 7 -7 6 7 154.575 -675.75 +-3 8 9 -7 8 9 206.375 -675.75 +-3 10 11 -7 10 11 257.7625 -675.75 +-3 12 13 -7 12 13 309.5625 -675.75 +-3 14 15 -7 14 15 360.95 -675.75 +-3 16 17 -7 16 17 412.75 -675.75 +-3 18 19 -7 18 19 464.1375 -675.75 +-3 20 21 -7 20 21 515.9375 -675.75 +-3 22 23 -7 22 23 567.325 -675.75 +-3 24 25 -7 24 25 619.125 -675.75 +-3 26 27 -7 26 27 670.5125 -675.75 +-3 28 29 -7 28 29 722.3125 -675.75 +-3 30 31 -7 30 31 773.7 -675.75 +-3 32 33 -7 32 33 42 -705.075 +-3 34 35 -7 34 35 93.3875 -705.075 +-3 36 37 -7 36 37 145.1875 -705.075 +-3 38 39 -7 38 39 196.575 -705.075 +-3 40 41 -7 40 41 248.375 -705.075 +-3 42 43 -7 42 43 299.7625 -705.075 +-3 44 45 -7 44 45 351.5625 -705.075 +-3 46 47 -7 46 47 402.95 -705.075 +-3 48 49 -7 48 49 454.75 -705.075 +-3 50 51 -7 50 51 506.1375 -705.075 +-3 52 53 -7 52 53 557.9375 -705.075 +-3 54 55 -7 54 55 609.325 -705.075 +-3 56 57 -7 56 57 661.125 -705.075 +-3 58 59 -7 58 59 712.5125 -705.075 +-3 60 61 -7 60 61 764.3125 -705.075 +-3 62 63 -7 62 63 815.7 -705.075 +-4 0 1 -8 0 1 84 -734.4 +-4 2 3 -8 2 3 135.3875 -734.4 +-4 4 5 -8 4 5 187.1875 -734.4 +-4 6 7 -8 6 7 238.575 -734.4 +-4 8 9 -8 8 9 290.375 -734.4 +-4 10 11 -8 10 11 341.7625 -734.4 +-4 12 13 -8 12 13 393.5625 -734.4 +-4 14 15 -8 14 15 444.95 -734.4 +-4 16 17 -8 16 17 496.75 -734.4 +-4 18 19 -8 18 19 548.1375 -734.4 +-4 20 21 -8 20 21 599.9375 -734.4 +-4 22 23 -8 22 23 651.325 -734.4 +-4 24 25 -8 24 25 703.125 -734.4 +-4 26 27 -8 26 27 754.5125 -734.4 +-4 28 29 -8 28 29 806.3125 -734.4 +-4 30 31 -8 30 31 857.7 -734.4 +-4 32 33 -8 32 33 126 -763.725 +-4 34 35 -8 34 35 177.3875 -763.725 +-4 36 37 -8 36 37 229.1875 -763.725 +-4 38 39 -8 38 39 280.575 -763.725 +-4 40 41 -8 40 41 332.375 -763.725 +-4 42 43 -8 42 43 383.7625 -763.725 +-4 44 45 -8 44 45 435.5625 -763.725 +-4 46 47 -8 46 47 486.95 -763.725 +-4 48 49 -8 48 49 538.75 -763.725 +-4 50 51 -8 50 51 590.1375 -763.725 +-4 52 53 -8 52 53 641.9375 -763.725 +-4 54 55 -8 54 55 693.325 -763.725 +-4 56 57 -8 56 57 745.125 -763.725 +-4 58 59 -8 58 59 796.5125 -763.725 +-4 60 61 -8 60 61 848.3125 -763.725 +-4 62 63 -8 62 63 899.7 -763.725