Changeset 984 for trunk/MagicSoft/Mars/mmontecarlo
- Timestamp:
- 10/24/01 13:57:43 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mmontecarlo
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc
r983 r984 103 103 } 104 104 105 UInt_t from = fDimension>0 ? 1 : -fDimension; 106 UInt_t to = fDimension>0 ? fDimension : -fDimension; 105 107 106 const UInt_t from = fDimension<=0 ? -fDimension : 0;108 fNum = to-from+1; 107 109 108 if (fDimension<=0) 109 fDimension = -fDimension; 110 Int_t num; 110 111 111 if (fDimension==0) 112 fDimension=1; 113 114 fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, fDimension)); 115 if (fMcTrig->GetEntriesFast() != fDimension) 112 fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, to)); 113 num = fMcTrig->GetEntriesFast(); 114 if (num != fNum) 116 115 { 117 *fLog << dbginf << "Error: Not all requested MMcTrig objects are available...aborting." << endl; 116 *fLog << dbginf << fNum << " MMcTrig objects requested, "; 117 *fLog << num << " are available... aborting." << endl; 118 118 return kFALSE; 119 119 } 120 120 121 fEnergy = new TObjArray(pList->FindCreateObjList("MHMcEnergy", from, fDimension)); 122 if (fMcTrig->GetEntriesFast() != fDimension && fDimension) 121 fEnergy = new TObjArray(pList->FindCreateObjList("MHMcEnergy", from, to)); 122 num = fMcTrig->GetEntriesFast(); 123 if (num != fNum) 123 124 { 124 *fLog << dbginf << "Error: Not all requested MHMcEnergy objects are available...aborting." << endl; 125 *fLog << dbginf << fNum << " MHMcEnergy objects requested, "; 126 *fLog << num << " are available... aborting." << endl; 125 127 return kFALSE; 126 128 } … … 141 143 const Float_t reciproc = 1./energy; 142 144 143 for (Int_t i=0; i<f Dimension; i++)145 for (Int_t i=0; i<fNum; i++) 144 146 if (GetTrig(i)->GetFirstLevel()>0) 145 147 GetHEnergy(i)->Fill(lg10, reciproc); … … 155 157 Bool_t MMcThresholdCalc::PostProcess() 156 158 { 157 for (Int_t i=0; i<f Dimension; i++)159 for (Int_t i=0; i<fNum; i++) 158 160 { 159 161 MHMcEnergy &hist = *GetHEnergy(i); -
trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.h
r893 r984 25 25 private: 26 26 Int_t fDimension; 27 Int_t fNum; 27 28 28 29 const MMcEvt *fMcEvt; // Container with Monte Carlo information -
trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc
r983 r984 43 43 *fTitle = title ? title : "Task to calc the trigger rate "; 44 44 45 fDimension =dim;45 fDimension = dim; 46 46 47 47 for (int i=0;i<10;i++) … … 111 111 } 112 112 113 const UInt_t from = fDimension<=0 ? -fDimension : 0; 114 115 if (fDimension<=0) 116 fDimension = -fDimension; 117 118 if (fDimension==0) 119 fDimension=1; 120 121 fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, fDimension)); 122 if (fMcTrig->GetEntriesFast() != fDimension) 123 { 124 *fLog << dbginf << "Error: Not all requested MMcTrig objects are available...aborting." << endl; 113 UInt_t from = fDimension>0 ? 1 : -fDimension; 114 UInt_t to = fDimension>0 ? fDimension : -fDimension; 115 116 fNum = to-from+1; 117 118 Int_t num; 119 120 fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, to)); 121 num = fMcTrig->GetEntriesFast(); 122 if (num != fNum) 123 { 124 *fLog << dbginf << fNum << " MMcTrig objects requested, "; 125 *fLog << num << " are available... aborting." << endl; 125 126 return kFALSE; 126 127 } 127 128 128 fMcRate = new TObjArray(pList->FindObjectList("MHMcRate", from, fDimension)); 129 if (fMcRate->GetEntriesFast() != fDimension) 130 { 131 *fLog << dbginf << "Error: Not all requested MHMcRate objects are available...aborting." << endl; 129 fMcRate = new TObjArray(pList->FindObjectList("MHMcRate", from, to)); 130 num = fMcRate->GetEntriesFast(); 131 if (num != fNum) 132 { 133 *fLog << dbginf << fNum << " MHMcRate objects requested, "; 134 *fLog << num << " are available... aborting." << endl; 132 135 return kFALSE; 133 136 } 134 137 135 for (int i=0; i<f Dimension; i++)138 for (int i=0; i<fNum; i++) 136 139 { 137 140 MHMcRate &rate = *GetRate(i); … … 175 178 // Counting number of triggers 176 179 // 177 for (int i=0; i<f Dimension; i++)180 for (int i=0; i<fNum; i++) 178 181 { 179 182 fTrigger[i] += GetTrig(i)->GetFirstLevel(); … … 194 197 // Computing trigger rate 195 198 // 196 for (int i=0; i<f Dimension; i++)199 for (int i=0; i<fNum; i++) 197 200 GetRate(i)->CalcRate(fTrigger[i], fAnalShow, fShowers); 198 201 -
trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h
r983 r984 27 27 Int_t fDimension; // Information about the trigger conditions 28 28 // in the root file to be read. 29 Int_t fNum; // decoded dimension 29 30 30 31 Float_t fTrigger[10]; // Number of triggered showers … … 38 39 39 40 MHMcRate *GetRate(UInt_t i) const { return (MHMcRate*)((*fMcRate)[i]); } 40 MMcTrig *GetTrig(UInt_t i) const { return (MMcTrig*)((*fMcTrig)[i]); }41 MMcTrig *GetTrig(UInt_t i) const { return (MMcTrig*)((*fMcTrig)[i]); } 41 42 42 43 public:
Note:
See TracChangeset
for help on using the changeset viewer.