Changeset 1007 for trunk/MagicSoft/Mars/mmontecarlo
- Timestamp:
- 10/29/01 13:22:33 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mmontecarlo
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc
r1005 r1007 44 44 fTitle = title ? title : "Task to calculate the collection area"; 45 45 46 fObjName = input ? input : "MMcTrig"; 46 if (input) 47 { 48 fObjName = input; 49 AddToBranchList(Form("%s.fNumFirstLevel", input)); 50 } 51 else 52 { 53 fObjName = "MMcTrig"; 54 AddToBranchList("fNumFirstLevel"); 55 } 56 57 AddToBranchList("fEnergy"); 58 AddToBranchList("fImpact"); 47 59 } 48 60 … … 74 86 Bool_t MMcCollectionAreaCalc::Process() 75 87 { 76 const Float_t energy = log10(fMcEvt->GetEnergy());88 const Float_t energy = fMcEvt->GetEnergy(); 77 89 const Float_t impact = fMcEvt->GetImpact()/100.; 78 90 -
trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc
r1004 r1007 67 67 MMcThresholdCalc::MMcThresholdCalc(const Int_t dim, const char* name, 68 68 const char* title) 69 : f Dimension(dim), fMcTrig(NULL), fEnergy(NULL)69 : fMcTrig(NULL), fEnergy(NULL) 70 70 { 71 71 fName = name ? name : "MMcThresholdCalc"; 72 72 fTitle = title ? title : "Task to calculate the energy threshold from Monte Carlo"; 73 74 fFirst = dim>0 ? 1 : -dim; 75 fLast = dim>0 ? dim : -dim; 76 77 fNum = fLast-fFirst+1; 78 79 AddToBranchList("fEnergy"); 80 AddToBranchList("MMcTrig", "fNumFirstLevel", fFirst, fLast); 73 81 } 74 82 … … 103 111 } 104 112 105 UInt_t from = fDimension>0 ? 1 : -fDimension; 106 UInt_t to = fDimension>0 ? fDimension : -fDimension; 113 UInt_t num; 107 114 108 fNum = to-from+1; 109 110 Int_t num; 111 112 fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, to)); 115 fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", fFirst, fLast)); 113 116 num = fMcTrig->GetEntriesFast(); 114 117 if (num != fNum) … … 119 122 } 120 123 121 fEnergy = new TObjArray(pList->FindCreateObjList("MHMcEnergy", f rom, to));124 fEnergy = new TObjArray(pList->FindCreateObjList("MHMcEnergy", fFirst, fLast)); 122 125 num = fMcTrig->GetEntriesFast(); 123 126 if (num != fNum) … … 143 146 const Float_t reciproc = 1./energy; 144 147 145 for ( Int_t i=0; i<fNum; i++)148 for (UInt_t i=0; i<fNum; i++) 146 149 if (GetTrig(i)->GetFirstLevel()>0) 147 150 GetHEnergy(i)->Fill(lg10, reciproc); … … 157 160 Bool_t MMcThresholdCalc::PostProcess() 158 161 { 159 for ( Int_t i=0; i<fNum; i++)162 for (UInt_t i=0; i<fNum; i++) 160 163 { 161 164 MHMcEnergy &hist = *GetHEnergy(i); -
trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.h
r984 r1007 24 24 { 25 25 private: 26 Int_t fDimension; 27 Int_t fNum; 26 UInt_t fFirst; 27 UInt_t fLast; 28 29 UInt_t fNum; 28 30 29 31 const MMcEvt *fMcEvt; // Container with Monte Carlo information -
trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc
r1004 r1007 47 47 fMcRate = NULL; 48 48 49 fDimension = dim;50 51 49 for (int i=0;i<10;i++) 52 50 fTrigger[i] = dim&&trigbg ? trigbg[i] : 0; … … 56 54 57 55 fPartId=part; 56 57 58 fFirst = dim>0 ? 1 : -dim; 59 fLast = dim>0 ? dim : -dim; 60 61 fNum = fLast-fFirst+1; 62 63 AddToBranchList("fImpact"); 64 AddToBranchList("fEnergy"); 65 AddToBranchList("fPhi"); 66 AddToBranchList("fTheta"); 67 AddToBranchList("fPhotElfromShower"); 68 AddToBranchList("MMcTrig", "fNumFirstLevel", fFirst, fLast); 58 69 } 59 70 … … 124 135 } 125 136 126 UInt_t from = fDimension>0 ? 1 : -fDimension; 127 UInt_t to = fDimension>0 ? fDimension : -fDimension; 128 129 fNum = to-from+1; 130 131 Int_t num; 132 133 fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, to)); 137 UInt_t num; 138 139 fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", fFirst, fLast)); 134 140 num = fMcTrig->GetEntriesFast(); 135 141 if (num != fNum) … … 140 146 } 141 147 142 fMcRate = new TObjArray(pList->FindObjectList("MHMcRate", f rom, to));148 fMcRate = new TObjArray(pList->FindObjectList("MHMcRate", fFirst, fLast)); 143 149 num = fMcRate->GetEntriesFast(); 144 150 if (num != fNum) … … 149 155 } 150 156 151 for ( int i=0; i<fNum; i++)157 for (UInt_t i=0; i<fNum; i++) 152 158 { 153 159 MHMcRate &rate = *GetRate(i); … … 191 197 // Counting number of triggers 192 198 // 193 for ( int i=0; i<fNum; i++)199 for (UInt_t i=0; i<fNum; i++) 194 200 { 195 201 fTrigger[i] += GetTrig(i)->GetFirstLevel(); … … 210 216 // Computing trigger rate 211 217 // 212 for ( int i=0; i<fNum; i++)218 for (UInt_t i=0; i<fNum; i++) 213 219 GetRate(i)->CalcRate(fTrigger[i], fAnalShow, fShowers); 214 220 -
trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h
r988 r1007 25 25 TObjArray *fMcTrig; 26 26 27 Int_t fDimension; // Information about the trigger conditions28 // in the root file to be read.29 Int_t fNum; // decoded dimension27 UInt_t fNum; // decoded dimension 28 UInt_t fFirst; 29 UInt_t fLast; 30 30 31 31 Float_t fTrigger[10]; // Number of triggered showers
Note:
See TracChangeset
for help on using the changeset viewer.