Changeset 3795 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 04/22/04 15:45:20 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 4 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);
Note:
See TracChangeset
for help on using the changeset viewer.