Changeset 7430 for trunk/MagicSoft/Mars
- Timestamp:
- 11/25/05 14:47:57 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7429 r7430 25 25 * datacenter/macros/plotdb.C: 26 26 - added new tabs for new columns 27 28 * mcamera/CameraLinkDef.h, mcamera/Makefile: 29 - added new classes MCameraTH, MCameraTD and MCameraRecTemp 30 31 * mhcalib/MHCalibrationPulseTimeCam.[h,cc]: 32 - added some const-qualifiers 33 34 * mreport/MReportCC.[h,cc]: 35 - updated to allow reading new CC reports 36 37 * merpp.cc: 38 - added contentent of new CC report to CC output tree 39 40 41 42 2005/11/25 Daniel Mazin (2005/11/02) 43 44 * mreflector/MRflEvtHeader.h 45 - added parameters first interaction point, telescope phi and theta, 46 fitted quantities from CORSIKA (number of particles in the shower 47 maximum, t0, tmax, chi2), fraction of electrons, muons and other 48 particles. Added getters and setters. 49 50 * mfileio/MReadRflFile.cc 51 - filled in the variables above 52 53 54 55 2005/11/25 A. Moralejo (2005/10/14) 56 57 * mreflector/MRflEvtHeader.h 58 - added parameters: energy, versor of primary's momentum and core 59 position on ground. Added getters and setters. 60 61 * mfileio/MReadRflFile.cc 62 - filled in the variables above 63 64 65 66 2005/11/25 Toni Coarasa (09/09/2005) 67 68 * msignal/MExtractTimeAndChargeDigitalFilter.cc 69 - fix a bug in the calculation of the high-gain times: 70 They were all shifted by the same amount "fHiGainFirst". This 71 caused an offset of usually 3 FADC slices in the times calculated 72 from high-gain and from low-gain. The bug did not have any effect 73 on the calibration runs because there, fHiGainFirst was set to 0. 74 The bug was there since 30.1.2005. 27 75 28 76 -
trunk/MagicSoft/Mars/merpp.cc
r7188 r7430 346 346 w->AddContainer("MTimeDrive", "Drive"); 347 347 w->AddContainer("MReportCC", "CC"); 348 w->AddContainer("MCameraTH", "CC"); 349 w->AddContainer("MCameraTD", "CC"); 350 w->AddContainer("MCameraRecTemp", "CC"); 348 351 w->AddContainer("MTimeCC", "CC"); 349 352 w->AddContainer("MReportStarguider", "Starguider"); -
trunk/MagicSoft/Mars/mfileio/MReadRflFile.cc
r4898 r7430 76 76 fIn->read((char*)&revth, sizeof(RflEventHeader_old)); 77 77 fEvtHeader->SetEvtNumber((int)revth.EvtNumber); 78 // *fLog << "Event Number: " << revth.EvtNumber;79 // *fLog << " Primary ID: " << revth.PrimaryID;80 // *fLog << " Run Number: " << revth.RunNumber << endl;81 return (bool)*fIn;82 78 } 83 79 else … … 86 82 fIn->read((char*)&revth, sizeof(RflEventHeader)); 87 83 fEvtHeader->SetEvtNumber((int)revth.EvtNumber); 88 // *fLog << "Event Number: " << revth.EvtNumber; 89 // *fLog << " Primary ID: " << revth.PrimaryID; 90 // *fLog << " Run Number: " << revth.RunNumber << endl; 91 return (bool)*fIn; 92 } 93 } 94 95 enum { 96 kError, 97 kEndOfFile, 98 kStartOfRun, 99 kEndOfRun, 100 kStartOfEvtData, 101 kEndOfEvtData, 102 kUndefined 103 }; 104 84 fEvtHeader->SetEnergy((int)revth.Etotal); 85 fEvtHeader->SetMomentum(revth.p[0], revth.p[1], revth.p[2]); 86 fEvtHeader->SetCorePosition(revth.CorePos[0][0], revth.CorePos[1][0]); 87 88 fEvtHeader->SetHeightFirstInt((Float_t)revth.zFirstInt); 89 90 fEvtHeader->SetPhi((Float_t)revth.telescopePhi); 91 fEvtHeader->SetTheta((Float_t)revth.telescopeTheta); 92 93 fEvtHeader->SetNmax((Float_t)revth.longi_Nmax); 94 fEvtHeader->SetT0((Float_t)revth.longi_t0); 95 fEvtHeader->SetTmax((Float_t)revth.longi_tmax); 96 fEvtHeader->SetChi2((Float_t)revth.longi_chi2); 97 98 fEvtHeader->SetEFraction((Float_t)revth.elec_cph_fraction); 99 fEvtHeader->SetMFraction((Float_t)revth.muon_cph_fraction); 100 fEvtHeader->SetOFraction((Float_t)revth.other_cph_fraction); 101 } 102 103 return (bool)*fIn; 104 } 105 105 106 106 int MReadRflFile::ReadFlag() … … 111 111 if (!fIn) 112 112 return kError; 113 114 //*fLog << "<" << TString(&flag[1], 11) << ">" <<endl;115 113 116 114 if (FlagIsA(flag, FLAG_END_OF_FILE)) -
trunk/MagicSoft/Mars/mfileio/MReadRflFile.h
r6499 r7430 18 18 { 19 19 private: 20 ifstream *fIn; // the inputfile 21 TList *fFileNames; // Array which stores the \0-terminated filenames 20 enum { 21 kError, 22 kEndOfFile, 23 kStartOfRun, 24 kEndOfRun, 25 kStartOfEvtData, 26 kEndOfEvtData, 27 kUndefined 28 }; 22 29 23 MRflEvtData *fEvtData; //! 24 MRflEvtHeader *fEvtHeader; 25 MRflRunHeader *fRunHeader; 30 ifstream *fIn; // the inputfile 31 TList *fFileNames; // Array which stores the \0-terminated filenames 26 32 27 UInt_t fNumFile; 28 UInt_t fEntries; // TO BE IMPLEMENTED 33 MRflEvtData *fEvtData; //! 34 MRflEvtHeader *fEvtHeader; //! 35 MRflRunHeader *fRunHeader; //! 36 37 UInt_t fNumFile; 38 UInt_t fEntries; // TO BE IMPLEMENTED 29 39 TString fFileName; 30 40 31 Float_t fCurrentVersion; //! Version of currently open rfl file41 Float_t fCurrentVersion; //! Version of currently open rfl file 32 42 33 43 float ReadVersion(); -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc
r7288 r7430 102 102 #include "MHCalibrationCam.h" 103 103 104 #include "MLog.h"105 #include "MLogManip.h"106 107 #include "MParList.h"108 109 #include "MHCalibrationPix.h"110 111 #include "MCalibrationIntensityCam.h"112 #include "MCalibrationChargeCam.h"113 #include "MCalibrationChargePix.h"114 115 #include "MGeomCam.h"116 #include "MGeomPix.h"117 118 #include "MBadPixelsIntensityCam.h"119 #include "MBadPixelsCam.h"120 #include "MBadPixelsPix.h"121 122 #include "MRawEvtData.h"123 #include "MRawRunHeader.h"124 #include "MRawEvtPixelIter.h"125 126 #include "MExtractedSignalCam.h"127 #include "MExtractedSignalPix.h"128 129 #include "MArrayI.h"130 #include "MArrayD.h"131 132 104 #include <TOrdCollection.h> 133 105 #include <TPad.h> … … 140 112 #include <TGraph.h> 141 113 #include <TEnv.h> 114 115 #include "MLog.h" 116 #include "MLogManip.h" 117 118 #include "MParList.h" 119 120 #include "MHCalibrationPix.h" 121 122 #include "MCalibrationIntensityCam.h" 123 #include "MCalibrationChargeCam.h" 124 #include "MCalibrationChargePix.h" 125 126 #include "MGeomCam.h" 127 #include "MGeomPix.h" 128 129 #include "MBadPixelsIntensityCam.h" 130 #include "MBadPixelsCam.h" 131 #include "MBadPixelsPix.h" 132 133 #include "MRawEvtData.h" 134 #include "MRawRunHeader.h" 135 #include "MRawEvtPixelIter.h" 136 137 #include "MExtractedSignalCam.h" 138 #include "MExtractedSignalPix.h" 139 140 #include "MArrayI.h" 141 #include "MArrayD.h" 142 142 143 143 ClassImp(MHCalibrationPulseTimeCam); … … 512 512 *fLog << endl; 513 513 514 MCalibrationCam *calcam = fIntensCam ? fIntensCam->GetCam() : fCam;514 MCalibrationCam &calcam = *(fIntensCam ? fIntensCam->GetCam() : fCam); 515 515 // 516 516 // Perform the fitting for the High Gain (done in MHCalibrationCam) … … 524 524 continue; 525 525 526 MCalibrationPix &pix = (*calcam)[i];526 MCalibrationPix &pix = calcam[i]; 527 527 CalcHists(hist,pix); 528 528 } … … 534 534 { 535 535 536 MHCalibrationPix &hist = GetAverageHiGainArea(j); 537 MCalibrationPix &pix = calcam ->GetAverageArea(j);536 MHCalibrationPix &hist = GetAverageHiGainArea(j); 537 MCalibrationPix &pix = calcam.GetAverageArea(j); 538 538 CalcHists(hist,pix); 539 539 } … … 541 541 for (Int_t j=0; j<fAverageHiGainSectors->GetSize(); j++) 542 542 { 543 MHCalibrationPix &hist = GetAverageHiGainSector(j); 544 MCalibrationPix &pix = calcam ->GetAverageSector(j);543 MHCalibrationPix &hist = GetAverageHiGainSector(j); 544 MCalibrationPix &pix = calcam.GetAverageSector(j); 545 545 CalcHists(hist,pix); 546 546 } … … 549 549 } 550 550 551 void MHCalibrationPulseTimeCam::CalcHists(MHCalibrationPix &hist, MCalibrationPix &pix) 551 void MHCalibrationPulseTimeCam::CalcHists(MHCalibrationPix &hist, MCalibrationPix &pix) const 552 552 { 553 553 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.h
r6729 r7430 61 61 void DrawDataCheckPixel(MHCalibrationPix &pix, const Float_t refline); 62 62 void DisplayRefLines ( const TH1F *hist, const Float_t refline) const; 63 void CalcHists (MHCalibrationPix &hist, MCalibrationPix &pix) ;63 void CalcHists (MHCalibrationPix &hist, MCalibrationPix &pix) const; 64 64 65 65 Int_t ReadEnv ( const TEnv &env, TString prefix, Bool_t print); -
trunk/MagicSoft/Mars/mreflector/MRflEvtHeader.cc
r2136 r7430 18 18 ! Author(s): Thomas Bretz, 5/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 320 ! Copyright: MAGIC Software Development, 2000-2005 21 21 ! 22 22 ! -
trunk/MagicSoft/Mars/mreflector/MRflEvtHeader.h
r2136 r7430 6 6 #endif 7 7 8 #ifndef ROOT_TVector3 9 #include <TVector3.h> 10 #endif 11 8 12 class MRflEvtHeader : public MParContainer 9 13 { 10 14 Int_t fEvtNumber; 11 15 16 Float_t fEnergy; // [GeV] of primary 17 18 TVector3 fMomentum; // versor of momentum of primary 19 TVector2 fCorePosition; // shower core position on ground 20 21 Float_t fHeightFirstInt; // [cm] z coordinate (height) of first interaction 22 23 Float_t fPhi; // Phi of the telescope 24 Float_t fTheta; // Theta of the telescope [rad] 25 26 Float_t fNmax; // number of particles in shower maximum fitted by CORSIKA 27 Float_t fT0; // depth of first interaction point fitted by CORSIKA 28 Float_t fTmax; // depth of the shower maximum fitted by CORSIKA 29 Float_t fChi2; // quality of the fit to longit shower development 30 31 /* Now follow the fraction of photons reaching the camera produced by * 32 * electrons, muons and other particles respectively: */ 33 Float_t fEFraction; // elec_cph_fraction 34 Float_t fMFraction; // muon_cph_fraction 35 Float_t fOFraction; // other_cph_fraction 36 12 37 public: 13 38 MRflEvtHeader(const char *name=NULL, const char *title=NULL); 14 39 40 // Getter 15 41 Int_t GetEvtNumber() const { return fEvtNumber; } 42 43 Float_t GetEnergy() const { return fEnergy; } 44 45 const TVector3 &GetMomentum() const { return fMomentum; } 46 const TVector2 &GetCorePosition() const { return fCorePosition; } 47 48 Float_t GetHeightFirstInt() const { return fHeightFirstInt; } 49 50 Float_t GetPhi() const { return fPhi; } 51 Float_t GetTheta() const { return fTheta; } 52 53 Float_t GetNmax() const { return fNmax; } 54 Float_t GetT0() const { return fT0; } 55 Float_t GetTmax() const { return fTmax; } 56 Float_t GetChi2() const { return fChi2; } 57 58 Float_t GetEFraction() const { return fEFraction; } 59 Float_t GetMFraction() const { return fMFraction; } 60 Float_t GetOFraction() const { return fOFraction; } 61 62 // Setter 16 63 void SetEvtNumber(Int_t n) { fEvtNumber = n; } 64 void SetEnergy(Float_t x) { fEnergy = x; } 65 void SetMomentum(const TVector3 &v) { fMomentum = v; } 66 void SetCorePosition(const TVector2 &v) { fCorePosition = v; } 17 67 18 ClassDef(MRflEvtHeader, 0) // Header of an event from the reflector program 68 void SetMomentum(Float_t px, Float_t py, Float_t pz) { fMomentum = TVector3(px, py, pz); } 69 void SetCorePosition(Float_t cx, Float_t cy) { fCorePosition = TVector2(cx, cy); } 70 void SetHeightFirstInt(Float_t x) { fHeightFirstInt = x; } 71 72 void SetPhi(Float_t x) { fPhi = x; } 73 void SetTheta(Float_t x) { fTheta = x; } 74 75 void SetNmax(Float_t x) { fNmax = x ; } 76 void SetT0(Float_t x) { fT0 = x; } 77 void SetTmax(Float_t x) { fTmax = x ; } 78 void SetChi2(Float_t x) { fChi2 = x ; } 79 80 void SetEFraction(Float_t x) { fEFraction = x ; } 81 void SetMFraction(Float_t x) { fMFraction = x ; } 82 void SetOFraction(Float_t x) { fOFraction = x ; } 83 84 ClassDef(MRflEvtHeader, 1) // Header of an event from the reflector program 19 85 }; 20 86 -
trunk/MagicSoft/Mars/mreport/MReportCC.cc
r7188 r7430 43 43 #include "MLogManip.h" 44 44 45 #include "MAstro.h" 45 #include "MParList.h" 46 47 #include "MCameraTH.h" 48 #include "MCameraTD.h" 49 #include "MCameraRecTemp.h" 46 50 47 51 ClassImp(MReportCC); … … 62 66 // -------------------------------------------------------------------------- 63 67 // 68 // FindCreate the following objects: 69 // - MCameraTH 70 // 71 Bool_t MReportCC::SetupReading(MParList &plist) 72 { 73 fTH = (MCameraTH*)plist.FindCreateObj("MCameraTH"); 74 if (!fTH) 75 return kFALSE; 76 77 fTD = (MCameraTD*)plist.FindCreateObj("MCameraTD"); 78 if (!fTD) 79 return kFALSE; 80 81 fRecTemp = (MCameraRecTemp*)plist.FindCreateObj("MCameraRecTemp"); 82 if (!fRecTemp) 83 return kFALSE; 84 85 return MReport::SetupReading(plist); 86 } 87 88 // -------------------------------------------------------------------------- 89 // 90 // Check whether the given TString begins with the given tag. Remove 91 // the tag from the string. 92 // 93 Bool_t MReportCC::CheckTag(TString &str, const char *tag) const 94 { 95 if (!str.BeginsWith(tag)) 96 { 97 *fLog << warn << "WARNING - '" << tag << "' tag not found." << endl; 98 return kFALSE; 99 } 100 str.Remove(0, strlen(tag)); // Remove Tag 101 return kTRUE; 102 } 103 104 105 // -------------------------------------------------------------------------- 106 // 64 107 // Interprete the body of the CC-REPORT string 65 108 // 66 Int_t MReportCC::InterpreteBody(TString &str, Int_t ver) 67 { 68 if (ver<200404070) 69 { 70 *fLog << err << "ERROR - MReportCC::InterpreteBody not prepared for "; 71 *fLog << " report-files with version<200404070" << endl; 72 return kFALSE; 73 } 74 109 Bool_t MReportCC::InterpreteCC(TString &str, Int_t ver) 110 { 75 111 const Int_t skip = ver<200407270 ? 30 : 31; 76 112 113 // Remove the 30/31 tokens of the subsystem status 114 // table 12.1 p59 77 115 for (int i=0; i<skip; i++) 78 116 str.Remove(0, str.First(' ')+1); … … 86 124 { 87 125 *fLog << warn << "WARNING - Wrong number of arguments." << endl; 88 return k CONTINUE;126 return kFALSE; 89 127 } 90 128 91 129 str.Remove(0, len); 92 130 93 for (int i=0; i<4; i++) // 2*UPS, TH, 577%x, TD, 577%x 94 str.Remove(0, str.First(' ')+1); 131 return kTRUE; 132 } 133 134 // -------------------------------------------------------------------------- 135 // 136 // Interprete the TH (discriminator thresholds) part of the report 137 // 138 Bool_t MReportCC::InterpreteTH(TString &str) 139 { 140 if (!CheckTag(str, "TH ")) 141 return kFALSE; 142 143 const char *pos = str.Data(); 144 const char *end = str.Data()+577*2; 145 146 Int_t i=0; 147 while (pos<end) 148 { 149 const Char_t hex[2] = { pos[0], pos[1] }; 150 pos += 2; 151 152 const Int_t n=sscanf(hex, "%2hx", &fTH->fTH[i++]); 153 if (n==1) 154 continue; 155 156 *fLog << warn << "WARNING - Reading hexadecimal TH information." << endl; 157 return kFALSE; 158 } 159 160 str.Remove(0, end-str.Data()); // Remove TH 161 str=str.Strip(TString::kLeading); 162 return kTRUE; 163 } 164 165 // -------------------------------------------------------------------------- 166 // 167 // Interprete the TD (discriminator delays) part of the report 168 // 169 Bool_t MReportCC::InterpreteTD(TString &str, Int_t ver) 170 { 171 if (!CheckTag(str, "TD ")) 172 return kFALSE; 173 174 const Int_t numpix = ver<200510250 ? 500 : 577; 175 176 const char *pos = str.Data(); 177 const char *end = str.Data()+numpix*2; 178 179 Int_t i=0; 180 while (pos<end) 181 { 182 const Char_t hex[3] = { pos[0], pos[1], 0 }; 183 pos += 2; 184 185 const Int_t n=sscanf(hex, "%2hx", &fTD->fTD[i++]); 186 if (n==1) 187 continue; 188 189 *fLog << warn << "WARNING - Reading hexadecimal TD information." << endl; 190 return kFALSE; 191 } 192 193 str.Remove(0, end-str.Data()); // Remove TD 194 str=str.Strip(TString::kLeading); 195 return kTRUE; 196 } 197 198 199 // -------------------------------------------------------------------------- 200 // 201 // Interprete the receiver board temperature part of the report 202 // 203 Bool_t MReportCC::InterpreteRecTemp(TString &str) 204 { 205 if (!CheckTag(str, "RECTEMP ")) 206 return kFALSE; 207 208 Int_t len; 209 for (Int_t i=0; i<76; i++) 210 { 211 const Int_t n=sscanf(str.Data(), "%f %n", &fRecTemp->fRecTemp[i], &len); 212 str.Remove(0, len); 213 214 if (n==1) 215 continue; 216 217 *fLog << warn << "WARNING - Reading Receiver Board Temperature information." << endl; 218 return kFALSE; 219 } 220 221 return kTRUE; 222 } 223 224 // -------------------------------------------------------------------------- 225 // 226 // Interprete the body of the CC-REPORT string 227 // 228 Int_t MReportCC::InterpreteBody(TString &str, Int_t ver) 229 { 230 if (ver<200404070) 231 { 232 *fLog << err << "ERROR - MReportCC::InterpreteBody not prepared for "; 233 *fLog << " report-files with version<200404070" << endl; 234 return kFALSE; 235 } 236 237 if (!InterpreteCC(str, ver)) 238 return kCONTINUE; 239 240 if (!InterpreteTH(str)) 241 return kCONTINUE; 242 243 if (!InterpreteTD(str, ver)) 244 return kCONTINUE; 245 246 if (ver>200510250) 247 if (!InterpreteRecTemp(str)) 248 return kCONTINUE; 95 249 96 250 if (str.Strip(TString::kBoth)!=(TString)"OVER") 97 251 { 98 *fLog << err << "ERROR - Termination (OVER) too far away." << endl;252 *fLog << warn << "WARNING - 'OVER' tag not found." << endl; 99 253 return kCONTINUE; 100 254 } -
trunk/MagicSoft/Mars/mreport/MReportCC.h
r7188 r7430 6 6 #endif 7 7 8 class MCameraTH; 9 class MCameraTD; 10 class MCameraRecTemp; 11 8 12 class MReportCC : public MReport 9 13 { 10 14 private: 11 Float_t fHumidity; // [%]12 Float_t fTemperature; // [deg] celsius13 Float_t fWindSpeed; // [km/h]14 Float_t fSolarRadiation; // [W/m^2] IR-Radiation15 Float_t fHumidity; // [%] 16 Float_t fTemperature; // [deg] celsius 17 Float_t fWindSpeed; // [km/h] 18 Float_t fSolarRadiation; // [W/m^2] IR-Radiation 15 19 16 Float_t fUPSStatus; // arbitrary units (still not properly defined)17 Float_t fDifRubGPS; // [us] Difference between the Rubidium clock time and the time provided by the GPS receiver20 Float_t fUPSStatus; // arbitrary units (still not properly defined) 21 Float_t fDifRubGPS; // [us] Difference between the Rubidium clock time and the time provided by the GPS receiver 18 22 23 MCameraTH *fTH; //! Discriminator thresholds 24 MCameraTD *fTD; //! Discriminator delays 25 MCameraRecTemp *fRecTemp; //! Receiver Board temperatures 26 27 // Internal 28 Bool_t SetupReading(MParList &plist); 29 Bool_t CheckTag(TString &str, const char *tag) const; 30 31 Bool_t InterpreteCC(TString &str, Int_t ver); 32 Bool_t InterpreteTH(TString &str); 33 Bool_t InterpreteTD(TString &str, Int_t ver); 34 Bool_t InterpreteRecTemp(TString &str); 35 36 // MReport 19 37 Int_t InterpreteBody(TString &str, Int_t ver); 20 38 -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
r7194 r7430 232 232 } 233 233 234 // New weights set 234 // 235 // shift the times back to the right reference (start counting from 0) 236 // 237 // The high-gain has the extraction offset (fHiGainFirst) already included 238 // here for speed reason. The low-gain has a changing extraction offset, 239 // so it will be added at every event (in FindTimeAndChargeLoGain) 235 240 fTimeShiftHiGain = 0.5 + 1./fBinningResolutionHiGain + fHiGainFirst; 236 241 fTimeShiftLoGain = 0.5 + 1./fBinningResolutionLoGain; … … 474 479 return; 475 480 476 time = max_p + fTimeShiftHiGain + (Float_t)fHiGainFirst /* this shifts the time to the start of the rising edge */477 - ((Float_t)t_iter)/fBinningResolutionHiGain;481 // here, the first high-gain slice is already included in the fTimeShiftHiGain 482 time = fTimeShiftHiGain + max_p - Float_t(t_iter)/fBinningResolutionHiGain; 478 483 479 484 const Float_t timefineadjust = time_sum/sum;
Note:
See TracChangeset
for help on using the changeset viewer.