Changeset 900 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 07/31/01 10:46:18 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHMcRate.cc
r896 r900 51 51 fBackSim=-1.0; // Number of simulated showers for the background 52 52 53 fTrig Rate= -1.0; // Trigger rate in Hz54 fTrig RateError= -1.0; // Estimated error for the trigger rate in Hz53 fTriggerRate= -1.0; // Trigger rate in Hz 54 fTriggerRateError= -1.0; // Estimated error for the trigger rate in Hz 55 55 } 56 56 … … 67 67 fFlux0=-1.0; // dn/dE = fFlux0 * E^{-a} 68 68 69 fShow Rate= -1.0; // Showers rate in Hz70 fShow RateError=0.0; // Estimated error of shower rate in Hz69 fShowerRate= -1.0; // Showers rate in Hz 70 fShowerRateError=0.0; // Estimated error of shower rate in Hz 71 71 } 72 72 … … 85 85 fFlux0=-1.0; // dn/dE = fFlux0 * E^{-a} 86 86 87 fShow Rate= showrate; // Showers rate in Hz88 fShow RateError=sqrt(showrate); // Estimated error of shower rate in Hz87 fShowerRate= showrate; // Showers rate in Hz 88 fShowerRateError=sqrt(showrate); // Estimated error of shower rate in Hz 89 89 } 90 90 … … 103 103 fFlux0=flux0; // dn/dE = fFlux0 * E^{-a} 104 104 105 fShow Rate= -1.0;106 fShow RateError=0.0;105 fShowerRate= -1.0; 106 fShowerRateError=0.0; 107 107 } 108 108 … … 130 130 // update the limits for energy, theta, phi and impact parameter 131 131 // 132 void MHMcRate:: Boundaries(Float_t energy, Float_t theta,133 Float_t phi, Float_t impact)132 void MHMcRate::UpdateBoundaries(Float_t energy, Float_t theta, 133 Float_t phi, Float_t impact) 134 134 { 135 135 // It updates the limit values … … 163 163 const Double_t epowmin = pow(fEnergyMin, specidx); 164 164 165 fShow Rate = fFlux0/specidx*(epowmax-epowmin);165 fShowerRate = fFlux0/specidx*(epowmax-epowmin); 166 166 167 167 if (fPartId!=1) 168 fShow Rate *= (fPhiMax-fPhiMin)*(cos(fThetaMax)-cos(fThetaMin));168 fShowerRate *= (fPhiMax-fPhiMin)*(cos(fThetaMax)-cos(fThetaMin)); 169 169 170 170 const Double_t impactdiff = fImpactMax-fImpactMin; 171 171 172 fShow Rate *= TMath::Pi()*(impactdiff/100.0*impactdiff/100.0);173 174 fShow RateError = sqrt(fShowRate);172 fShowerRate *= TMath::Pi()*(impactdiff/100.0*impactdiff/100.0); 173 174 fShowerRateError = sqrt(fShowerRate); 175 175 176 176 const Double_t anal2 = 1.0-anal*160.0e-9; … … 179 179 // Then the trigger rate and its error is evaluated 180 180 if(fBackTrig<0){ 181 fTrig RateError = sqrt((trig*fShowRate*fShowRate/(simu*simu)) +181 fTriggerRateError = sqrt((trig*fShowerRate*fShowerRate/(simu*simu)) + 182 182 (anal2*anal2*1/(fBackSim*back2*back2))); 183 183 fBackTrig=0; 184 184 } 185 185 else 186 fTrig RateError = sqrt((trig*fShowRate*fShowRate/(simu*simu)) +186 fTriggerRateError = sqrt((trig*fShowerRate*fShowerRate/(simu*simu)) + 187 187 (anal2*anal2*fBackTrig/(back2*back2))); 188 188 189 fTrig Rate = trig*fShowRate/simu + anal2*fBackTrig/back2;189 fTriggerRate = trig*fShowerRate/simu + anal2*fBackTrig/back2; 190 190 } 191 191 … … 194 194 // print the trigger rate 195 195 // 196 void MHMcRate::Print( )197 { 198 *fLog << "Incident rate " << fShow Rate << " Hz " << endl;199 *fLog << "Trigger Rate " << fTrig Rate << " +- " << fTrigRateError << " Hz" << endl;196 void MHMcRate::Print(Option_t *) 197 { 198 *fLog << "Incident rate " << fShowerRate << " Hz " << endl; 199 *fLog << "Trigger Rate " << fTriggerRate << " +- " << fTriggerRateError << " Hz" << endl; 200 200 } 201 201 … … 204 204 // draw the trigger rate 205 205 // 206 void MHMcRate::Draw(Option_t * option)206 void MHMcRate::Draw(Option_t *) 207 207 { 208 208 *fLog << "To be iplemented" << endl; -
trunk/MagicSoft/Mars/mhist/MHMcRate.h
r896 r900 9 9 #endif 10 10 11 #define PI_NUMBER 3.1415926 11 class MHMcRate : public MParContainer 12 { 12 13 13 class MHMcRate : public MParContainer { 14 private: 15 UShort_t fPartId; // Type of particle 14 16 15 private:16 UShort_t fPartId; // Type of particle17 Float_t fEnergyMax; // Maximum Energy in GeV 18 Float_t fEnergyMin; // Minimum Energy in GeV 17 19 18 Float_t fEnergyMax; // Maximum Energy in GeV 19 Float_t fEnergyMin; // Minimum Energy in GeV 20 Float_t fThetaMax; // Maximum theta angle of run 21 Float_t fThetaMin; // Minimum theta angle of run 22 Float_t fPhiMax; // Maximum phi angle of run 23 Float_t fPhiMin; // Minimum phi angle of run 20 24 21 Float_t fThetaMax; // Maximum theta angle of run 22 Float_t fThetaMin; // Minimum theta angle of run 23 Float_t fPhiMax; // Maximum phi angle of run 24 Float_t fPhiMin; // Minimum phi angle of run 25 Float_t fImpactMax; // Maximum impact parameter 26 Float_t fImpactMin; // Minimum impact parameter 25 27 26 Float_t fImpactMax; // Maximum impact parameter 27 Float_t fImpactMin; // Minimum impact parameter 28 29 Float_t fBackTrig; // Number of triggers from background 30 Float_t fBackSim; // Number of simulated showers for the background 28 Float_t fBackTrig; // Number of triggers from background 29 Float_t fBackSim; // Number of simulated showers for the background 31 30 32 Float_t fSpecIndex;// dn/dE = k * e^{- fSpecIndex}33 Float_t fFlux0;// dn/dE = fFlux0 * E^{-a}31 Float_t fSpecIndex; // dn/dE = k * e^{- fSpecIndex} 32 Float_t fFlux0; // dn/dE = fFlux0 * E^{-a} 34 33 35 Float_t fShowRate; // Showers rate in Hz36 Float_t fShowRateError; // Estimated error of shower rate in Hz34 Float_t fShowerRate; // Showers rate in Hz 35 Float_t fShowerRateError; // Estimated error of shower rate in Hz 37 36 38 Float_t fTrigRate;// Trigger rate in Hz39 Float_t fTrigRateError;// Estimated error for the trigger rate in Hz37 Float_t fTriggerRate; // Trigger rate in Hz 38 Float_t fTriggerRateError; // Estimated error for the trigger rate in Hz 40 39 41 void Init(const char *name, const char *title);40 void Init(const char *name, const char *title); 42 41 43 public: 44 45 MHMcRate(const char *name=NULL, const char *title=NULL) ; 46 MHMcRate(Float_t ShowRate, 47 const char *name=NULL, const char *title=NULL) ; 48 MHMcRate(Float_t SpecIndex, Float_t Flux0, 49 const char *name=NULL, const char *title=NULL) ; 50 ~MHMcRate() ; 42 public: 51 43 52 void SetParticle(UShort_t part); 53 void SetBackground (Float_t Showers, Float_t Triggers); 44 MHMcRate(const char *name=NULL, const char *title=NULL); 45 MHMcRate(Float_t showrate, 46 const char *name=NULL, const char *title=NULL); 47 MHMcRate(Float_t specindex, Float_t flux0, 48 const char *name=NULL, const char *title=NULL); 54 49 55 void Boundaries(Float_t Energy, Float_t Theta, Float_t Phi, Float_t Impact); 50 void SetParticle(UShort_t part); 51 void SetBackground(Float_t showers, Float_t triggers); 56 52 57 void CalcRate(Float_t trig, Float_t anal, Float_t simu);53 void UpdateBoundaries(Float_t energy, Float_t theta, Float_t phi, Float_t impact); 58 54 59 void Print(); 60 void Draw(const Option_t *); 55 void CalcRate(Float_t trig, Float_t anal, Float_t simu); 61 56 62 ClassDef(MHMcRate, 1) // Data Container to calculate Collection Area 63 } ; 57 void Print(Option_t *o=NULL); 58 void Draw(Option_t *o=NULL); 59 60 ClassDef(MHMcRate, 1) // Data Container to calculate Collection Area 61 }; 64 62 65 63 #endif
Note:
See TracChangeset
for help on using the changeset viewer.