Changeset 6607
- Timestamp:
- 02/18/05 17:08:10 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/readCalibration.C
r4237 r6607 35 35 static const TString inpath = "."; 36 36 // 37 // Tell if you want to calibrate times:38 //39 static const Bool_t useTimes = kTRUE;40 //41 // the default pedestal run for the calibration42 //43 static const Int_t pedrun = 26210;44 //45 37 // the default start calibration run 46 38 // 47 39 static const Int_t calrun = 26209; 48 40 // 49 // A switch to output debugging information about Objects use50 //51 static const Bool_t debug = kFALSE;52 //53 41 // Tell if you want to use the display: 54 42 // 55 static Bool_t useDisplay = k TRUE;43 static Bool_t useDisplay = kFALSE; 56 44 // 57 void readCalibration(const Int_t prun=pedrun, const Int_tcrun=calrun)45 void readCalibration(const Int_t crun=calrun) 58 46 { 59 47 60 const TString pedname = Form("%s/%i-F0.root", (const char*)inpath,prun); 61 const TString calname = Form("%s/%i-F1.root", (const char*)inpath,crun); 62 const TString testname = Form("%s/%i-Test.root", (const char*)inpath,crun); 63 64 if (gSystem->AccessPathName(pedname, kFileExists)) 65 { 66 cout << "Input file " << pedname << " doesn't exist." << endl; 67 return; 68 } 48 const TString calname = Form("%s/calib%08d.root", (const char*)inpath,crun); 69 49 70 50 if (gSystem->AccessPathName(calname, kFileExists)) 71 51 { 72 52 cout << "Input file " << calname << " doesn't exist." << endl; 73 return;74 }75 76 if (gSystem->AccessPathName(testname, kFileExists))77 {78 cout << "Input file " << testname << " doesn't exist." << endl;79 53 return; 80 54 } … … 85 59 display = new MStatusDisplay; 86 60 61 MPedestalCam pedcam; 62 MCalibrationChargeCam chargecam; 63 MCalibrationQECam qecam; 64 MCalibrationRelTimeCam relcam; 65 MBadPixelsCam badcam; 87 66 88 MPedestalCam pedcam;89 MCalibrationChargeCam chargecam;90 MCalibrationQECam qecam;91 MCalibrationRelTimeCam reltimecam;92 MBadPixelsCam badcam;93 MHCalibrationTestCam testcam;94 MHCalibrationTestTimeCam testtime;95 96 cout << "Reading from file: " << pedname << endl;97 98 TFile pedfile(pedname, "READ");99 if (pedcam.Read()<=0)100 {101 cout << "Unable to read MPedestalCam from " << pedname << endl;102 return;103 }104 105 if (useDisplay)106 {107 if (display->GetCanvas("Pedestals"))108 display->Read();109 }110 111 67 cout << "Reading from file: " << calname << endl; 112 68 … … 117 73 return; 118 74 } 119 120 75 if (qecam.Read()<=0) 121 76 { … … 124 79 } 125 80 126 if (reltimecam.Read()<=0) 127 { 128 cout << "Unable to read MCalibrationRelTimeCam from " << calname << endl; 129 return; 130 } 131 132 if (calfile.FindKey("MBadPixelsCam")) 81 if (calfile.FindKey("MBadPixelsCam")) 133 82 { 134 83 MBadPixelsCam bad; … … 140 89 badcam.Merge(bad); 141 90 } 91 if (relcam.Read()<=0) 92 { 93 cout << "Unable to read MCalibrationRelTimeCam from " << calname << endl; 94 return; 95 } 96 97 cout << "Size of QECam: " << qecam.GetSize() << endl; 98 cout << "Size of BlindCam: " << blindcam.GetSize() << endl; 99 cout << "Size of Chargecam: " << chargecam.GetSize() << endl; 100 cout << "Size of RelTimeCam: " << relcam.GetSize() << endl; 101 102 MGeomCamMagic geom; 142 103 143 104 if (useDisplay) 144 105 display->Read(); 145 146 cout << "Reading from file: " << testname << endl; 106 107 for (Int_t i=0; i<relcam.GetSize(); i++) 108 { 109 MCalibrationRelTimePix &rpix = (MCalibrationRelTimePix&)relcam[i]; 110 cout << "Number of outliers in time pixel: " << i << ": " << rpix.GetNumPickup()+rpix.GetNumBlackout() << endl; 111 } 147 112 148 TFile testfile(testname, "READ"); 149 if (testcam.Read()<=0) 113 for (Int_t i=0; i<2; i++) 114 { 115 TArrayF conv = chargecam.GetAveragedConvFADC2PhotPerArea(geom,qecam,i,&badcam); 116 cout << "Average Conv Factor Area idx: " << i << ": " << conv[0] << "+-" << conv[1] << endl; 117 } 118 119 for (Int_t i=0; i<qecam.GetSize(); i++) 150 120 { 151 cout << "Unable to read MHCalibrationTestCam from " << testname << endl; 152 return; 121 MCalibrationChargePix &cpix = (MCalibrationChargePix&)chargecam[i]; 122 MCalibrationQEPix &qpix = (MCalibrationQEPix&) qecam[i]; 123 cout << "Conversion Factor: " << cpix.GetMeanConvFADC2Phe() / qpix.GetQECascadesFFactor() << endl; 153 124 } 154 if (testtime.Read()<=0)155 {156 cout << "Unable to read MHCalibrationTestTimeCam from " << testname << endl;157 return;158 }159 160 if (useDisplay)161 display->Read();162 163 //164 // List of interesting plots:165 //166 /*167 testcam.GetAverageHiGainArea(0).DrawClone();168 testcam.GetAverageLoGainArea(0).DrawClone();169 testcam.GetAverageHiGainArea(1).DrawClone();170 testcam.GetAverageLoGainArea(1).DrawClone();171 172 testcam.GetAverageHiGainSector(1).DrawClone();173 testcam.GetAverageLoGainSector(1).DrawClone();174 testcam.GetAverageHiGainSector(2).DrawClone();175 testcam.GetAverageLoGainSector(2).DrawClone();176 testcam.GetAverageHiGainSector(3).DrawClone();177 testcam.GetAverageLoGainSector(3).DrawClone();178 testcam.GetAverageHiGainSector(4).DrawClone();179 testcam.GetAverageLoGainSector(4).DrawClone();180 testcam.GetAverageHiGainSector(5).DrawClone();181 testcam.GetAverageLoGainSector(5).DrawClone();182 testcam.GetAverageHiGainSector(6).DrawClone();183 testcam.GetAverageLoGainSector(6).DrawClone();184 */185 186 187 188 125 189 126 }
Note:
See TracChangeset
for help on using the changeset viewer.