Changeset 3795 for trunk/MagicSoft/Mars
- Timestamp:
- 04/22/04 15:45:20 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.cc
r2918 r3795 68 68 // Correspondence TABLE between pixel numbering in the trigger cells and 69 69 // the standard spiral counting 70 // ( Note: Pixels start to count from 1instead of 0)70 // (*Note*: Pixels start to count ** from 1 ** instead of 0) 71 71 // 72 72 // This correspondence is valid only for MAGIC-like geometries! … … 812 812 void MMcTriggerLvl2::GetEnergy(MMcEvt *fMcEvt) 813 813 { 814 const MMcEvt &h = *(MMcEvt *)fMcEvt;815 fEnergy = h.GetEnergy();816 return;814 const MMcEvt &h = *(MMcEvt *)fMcEvt; 815 fEnergy = h.GetEnergy(); 816 return; 817 817 } 818 818 … … 1007 1007 } 1008 1008 1009 //--------------------------------------------------------------------- 1010 // Check if a given pixel is in the trigger region 1011 // 1012 Bool_t MMcTriggerLvl2::IsPixelInTrigger(Int_t pixel) const 1013 { 1014 for (int cell=0; cell<gsNCells; cell++) 1015 for (int i=0; i<gsNPixInCell; i++) 1016 if ((gsPixelsInCell[i][cell]-1) == pixel) 1017 return kTRUE; 1018 1019 return kFALSE; 1020 } 1021 1022 // -------------------------------------------------------------------------- 1023 // 1024 // Returns, depending on the type flag: 1025 // 1026 // 0: 1,0 if the pixel is triggered (1) or not (0) 1027 // 1028 // 1029 Bool_t MMcTriggerLvl2::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const 1030 { 1031 // Pixel in no-trigger region are set to 0 1032 val = this->IsPixelInTrigger(idx) ? fFiredPixel[idx]+fCompactPixel[idx] : 0; 1033 1034 return kTRUE; 1035 } 1036 1037 void MMcTriggerLvl2::DrawPixelContent(Int_t num) const 1038 { 1039 *fLog << "MMcTriggerLvl2::DrawPixelContent - not available." << endl; 1040 } -
trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.h
r2919 r3795 1 1 #ifndef MARS_MMcTriggerLvl2 2 2 #define MARS_MMcTriggerLvl2 3 4 #ifndef MARS_MCamEvent 5 #include "MCamEvent.h" 6 #endif 3 7 4 8 #ifndef MARS_MParContainer … … 12 16 class MGeomPix; 13 17 14 class MMcTriggerLvl2 : public MParContainer 18 class MMcTriggerLvl2 : public MParContainer, public MCamEvent 15 19 { 16 20 private: … … 86 90 Int_t GetTriggerPattern() const {return fTriggerPattern;} 87 91 88 void GetEnergy(MMcEvt *fMcEvt = NULL); 89 Double_t GetEnergy() const {return fEnergy;} 92 void GetEnergy(MMcEvt *fMcEvt = NULL); 93 Double_t GetEnergy() const {return fEnergy;} 90 94 91 95 Bool_t IsPixelInCell(Int_t pixel, Int_t cell); 96 Bool_t IsPixelInTrigger(Int_t pixel) const; 97 98 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 99 void DrawPixelContent(Int_t num) const; 100 92 101 93 102 ClassDef(MMcTriggerLvl2,0) // Container for 2nd Level Trigger selection parameters -
trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc
r2446 r3795 43 43 #include "MLogManip.h" 44 44 45 #include "MMcEvt.hxx"45 //#include "MMcEvt.hxx" 46 46 #include "MMcTrig.hxx" 47 #include "MRawRunHeader.h" 47 48 #include "MMcRunHeader.hxx" 48 49 … … 61 62 { 62 63 fName = name ? name : "MMcTriggerLvl2Calc"; 63 fTitle = title ? title : "Task to Fill the MMcTriggerLvl2 object"; 64 fTitle = title ? title : "Task to Fill the MMcTriggerLvl2 object"; 65 } 66 67 // -------------------------------------------------------------------------- 68 // 69 // Check for the run type. Return kTRUE if it is a MC run or if there 70 // is no MC run header (old camera files) kFALSE in case of a different 71 // run type 72 // 73 Bool_t MMcTriggerLvl2Calc::CheckRunType(MParList *pList) const 74 { 75 const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 76 if (!run) 77 { 78 *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl; 79 return kTRUE; 80 } 64 81 65 } 66 67 68 // -------------------------------------------------------------------------- 69 // 70 // PreProcess 71 // 72 // 73 Int_t MMcTriggerLvl2Calc::PreProcess (MParList *pList) 74 { 75 // connect the raw data with this task 76 82 return run->IsMonteCarloRun(); 83 } 84 85 // -------------------------------------------------------------------------- 86 // 87 // Check for the runtype. 88 // Search for . 89 // 90 Bool_t MMcTriggerLvl2Calc::ReInit(MParList *pList) 91 { 92 // 93 // If it is no MC file skip this function... 94 // 95 if (!CheckRunType(pList)) 96 { 97 *fLog << inf << "This is no MC file... skipping." << endl; 98 return kTRUE; 99 } 100 101 // 102 // Check all necessary containers 103 // 77 104 fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt"); 78 if (!fMcEvt)79 {80 *fLog << err << dbginf << "MMcEvt not found... exit." << endl;81 return kFALSE;82 }105 if (!fMcEvt) 106 { 107 *fLog << err << dbginf << "MMcEvt not found... exit." << endl; 108 return kFALSE; 109 } 83 110 84 111 fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig"); … … 102 129 return kFALSE; 103 130 } 104 fMMcTriggerLvl2 = (MMcTriggerLvl2*)pList->FindObject("MMcTriggerLvl2"); 131 132 return kTRUE; 133 } 134 135 136 // -------------------------------------------------------------------------- 137 // 138 // PreProcess 139 // Check the exxistence of the MMcTriggerLvl2 containers and the correct 140 // setting of the fCompactNN that defines a compact pixel 141 // 142 Int_t MMcTriggerLvl2Calc::PreProcess (MParList *pList) 143 { 144 145 // fMMcTriggerLvl2 = (MMcTriggerLvl2*)pList->FindObject("MMcTriggerLvl2"); 146 fMMcTriggerLvl2 = (MMcTriggerLvl2*)pList->FindCreateObj("MMcTriggerLvl2"); 105 147 if (!fMMcTriggerLvl2) 106 148 { … … 138 180 Int_t MMcTriggerLvl2Calc::Process() 139 181 { 140 fMMcTriggerLvl2->GetEnergy(fMcEvt);182 // fMMcTriggerLvl2->GetEnergy(fMcEvt); 141 183 142 184 fMMcTriggerLvl2->SetLv1(fMcTrig); -
trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.h
r2365 r3795 32 32 Int_t PostProcess(); 33 33 34 Bool_t ReInit(MParList *pList); 35 Bool_t CheckRunType(MParList *pList) const; 36 34 37 public: 35 38 MMcTriggerLvl2Calc(const char *name=NULL, const char *title=NULL); -
trunk/MagicSoft/Mars/mhist/MHEvent.cc
r3400 r3795 53 53 54 54 #include "MMcEvt.hxx" 55 #include "MMcTrig.hxx" 55 56 56 57 #include "MHCamera.h" … … 95 96 fMcEvt = (MMcEvt*)plist->FindObject("MMcEvt"); 96 97 97 fRawEvtData = (MRawEvtData*)plist->FindObject("MRawEvtData");98 if (!fRawEvtData)98 fRawEvtData = (MRawEvtData*)plist->FindObject("MRawEvtData"); 99 if (!fRawEvtData) 99 100 *fLog << warn << "MRawEvtData not found..." << endl; 100 101 … … 161 162 fHist->SetPrettyPalette(); 162 163 break; 164 case kEvtTrigPix: 165 fHist->SetName("Triggered pix"); 166 fHist->SetYTitle("ON/OFF"); 167 fHist->SetPrettyPalette(); 168 break; 163 169 } 164 170 … … 214 220 break; 215 221 case kEvtArrTime: 222 fHist->SetCamContent(*event, 0); 223 break; 224 case kEvtTrigPix: 216 225 fHist->SetCamContent(*event, 0); 217 226 break; -
trunk/MagicSoft/Mars/mhist/MHEvent.h
r3239 r3795 12 12 13 13 class MMcEvt; 14 class MMcTrig; 14 15 class MCerPhotEvt; 15 16 class MImgCleanStd; … … 22 23 kEvtSignalRaw, kEvtSignalDensity, kEvtPedestal, 23 24 kEvtPedestalRMS, kEvtRelativeSignal, kEvtCleaningLevels, 24 kEvtIdxMax, kEvtArrTime 25 kEvtIdxMax, kEvtArrTime, kEvtTrigPix 25 26 }; 26 27 … … 31 32 32 33 MMcEvt *fMcEvt; //! 34 MMcTrig *fMcTrig; //! 33 35 MCerPhotEvt *fCerPhotEvt; //! 34 36 MImgCleanStd *fImgCleanStd; //! -
trunk/MagicSoft/Mars/mhistmc/Makefile
r2800 r3795 23 23 # 24 24 INCLUDES = -I. -I../mbase -I../mhbase -I../mhist -I../mmc -I../manalysis \ 25 -I../mimage -I../mgeom 25 -I../mimage -I../mgeom -I../mgui 26 26 27 27 #------------------------------------------------------------------------------ -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r3768 r3795 75 75 #include "MMcCalibrationUpdate.h" // MMcCalibrationUpdate 76 76 #include "MCalibrate.h" // MCalibrate 77 #include "MMcTriggerLvl2Calc.h" // MMcTriggerLvl2Calc 77 78 78 79 // … … 90 91 #include "MPedPhotCam.h" // MPedPhotCam 91 92 #include "MCalibrationChargeCam.h" // MCalibrationChargeCam 93 #include "MMcTriggerLvl2.h" // MMcTriggerLvl2 92 94 93 95 ClassImp(MEventDisplay); … … 221 223 MHEvent *evt7 = new MHEvent(MHEvent::kEvtIdxMax); 222 224 MHEvent *evt8 = new MHEvent(MHEvent::kEvtArrTime); 225 MHEvent *evt9 = new MHEvent(MHEvent::kEvtTrigPix); 223 226 224 227 evt1->SetName("Signal"); … … 230 233 evt7->SetName("Max Slice Idx"); 231 234 evt8->SetName("Arrival Time"); 235 evt9->SetName("Trigger"); 232 236 233 237 // This makes sure, that the containers are deleted... … … 240 244 plist->AddToList(evt7); 241 245 plist->AddToList(evt8); 246 plist->AddToList(evt9); 242 247 243 248 MCerPhotAnal2 *nanal = new MCerPhotAnal2; … … 252 257 MHillasCalc *hcalc = new MHillasCalc; 253 258 MHillasSrcCalc *scalc = new MHillasSrcCalc; 259 MMcTriggerLvl2Calc *trcal = new MMcTriggerLvl2Calc; 260 MFillH *fill9 = new MFillH(evt9, "MMcTriggerLvl2", "MFillH9"); 254 261 255 262 // If no pedestal or no calibration file is availble … … 265 272 266 273 MExtractSignal* extra = new MExtractSignal(); 267 extra->SetRange( 5, 10, 5, 10);274 extra->SetRange(0, 6, 2, 7); 268 275 extra->SetSaturationLimit(240); 269 276 … … 278 285 mcupd->SetFilter(f1); 279 286 mccal->SetFilter(f1); 287 trcal->SetFilter(f1); 280 288 281 289 // Data … … 292 300 tlist->AddToList(mccal); 293 301 294 tlist->AddToList(nanal); 302 303 tlist->AddToList(nanal); 295 304 } 296 305 else … … 310 319 tlist->AddToList(hcalc); 311 320 tlist->AddToList(scalc); 321 312 322 if (!pcam || !ccam) 313 323 { … … 318 328 tlist->AddToList(fill7); 319 329 tlist->AddToList(fill8); 330 331 tlist->AddToList(trcal); 332 tlist->AddToList(fill9); 320 333 } 321 334 … … 518 531 ((MHillasSrc*) plist->FindObject("MHillasSrc"))->Print(*geom); 519 532 ((MNewImagePar*)plist->FindObject("MNewImagePar"))->Print(*geom); 520 533 521 534 // 522 535 // UpdateDisplay
Note:
See TracChangeset
for help on using the changeset viewer.