Changeset 954 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 09/28/01 10:51:06 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc
r929 r954 109 109 } 110 110 111 TObject *MHMcCollectionArea::DrawClone(Option_t* option) 112 { 113 TCanvas *c=new TCanvas(fHistCol->GetName(), fHistCol->GetTitle()); 114 115 // 116 // This is necessary to get the expected bahviour of DrawClone 117 // 118 gROOT->SetSelectedPad(NULL); 119 120 fHistCol->DrawClone(option); 121 122 c->Modified(); 123 c->Update(); 124 125 return c; 126 } 127 111 128 void MHMcCollectionArea::Draw(Option_t* option) 112 129 { -
trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.h
r867 r954 36 36 void DrawAll(Option_t *option = ""); 37 37 void DrawSel(Option_t *option = ""); 38 void Draw (Option_t *option = ""); 38 39 void Draw(Option_t *option = NULL); 40 TObject *DrawClone(Option_t *option = NULL); 39 41 40 42 void CalcEfficiency(); -
trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc
r891 r954 133 133 } 134 134 135 // ------------------------------------------------------------------------ 136 // 137 // Drawing function. It creates its own canvas. 138 // 139 void MHMcEnergy::Draw(Option_t *option) 135 void MHMcEnergy::DrawLegend() const 140 136 { 141 137 char text[256]; … … 144 140 const Float_t max = fHist->GetMaximum(); 145 141 const Float_t sum = min+max; 146 147 TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle());148 149 fHist->Draw(option);150 142 151 143 sprintf(text, "Energy Threshold = %4.1f +- %4.1f GeV", … … 157 149 label->SetBit(kCanDelete); 158 150 label->Draw(); 151 } 152 153 // ------------------------------------------------------------------------ 154 // 155 // Drawing function. It creates its own canvas. 156 // 157 void MHMcEnergy::Draw(Option_t *option) 158 { 159 TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle()); 160 161 fHist->Draw(option); 162 163 DrawLegend(); 159 164 160 165 c->Modified(); 161 166 c->Update(); 167 } 168 169 TObject *MHMcEnergy::DrawClone(Option_t *option) 170 { 171 TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle()); 172 173 // 174 // This is necessary to get the expected bahviour of DrawClone 175 // 176 gROOT->SetSelectedPad(NULL); 177 178 fHist->DrawClone(option); 179 180 DrawLegend(); 181 182 c->Modified(); 183 c->Update(); 184 185 return c; 162 186 } 163 187 -
trunk/MagicSoft/Mars/mhist/MHMcEnergy.h
r891 r954 29 29 Float_t CalcGaussSigma(TF1 *gauss); 30 30 31 void DrawLegend() const; 32 31 33 public: 32 34 … … 47 49 48 50 void Draw(Option_t* option = ""); 51 TObject *DrawClone(Option_t* option = ""); 49 52 void Print(Option_t* option = NULL); 50 53 -
trunk/MagicSoft/Mars/mhist/MHMcRate.cc
r900 r954 27 27 28 28 #include "MLog.h" 29 #include "MLogManip.h" 29 30 30 31 ClassImp(MHMcRate); … … 35 36 *fTitle = title ? title : "Task to calc the collection area "; 36 37 37 fPartId=0; // Type of particle38 39 fEnergyMax=0.0; // Maximum Energy in GeV40 fEnergyMin=1000000.0; // Minimum Energy in GeV41 42 fThetaMax=0.0; // Maximum theta angle of run43 fThetaMin=370.0; // Minimum theta angle of run44 fPhiMax=0.0; // Maximum phi angle of run45 fPhiMin=370.0; // Minimum phi angle of run46 47 fImpactMax=0.0; // Maximum impact parameter48 fImpactMin=100000.0; // Minimum impact parameter49 50 fBackTrig=-1.0; // Number of triggers from background51 fBackSim=-1.0; // Number of simulated showers for the background52 53 fTriggerRate= -1.0; 54 fTriggerRateError= -1.0; 38 fPartId=0; // Type of particle 39 40 fEnergyMax=0.0; // Maximum Energy in GeV 41 fEnergyMin=1000000.0; // Minimum Energy in GeV 42 43 fThetaMax=0.0; // Maximum theta angle of run 44 fThetaMin=370.0; // Minimum theta angle of run 45 fPhiMax=0.0; // Maximum phi angle of run 46 fPhiMin=370.0; // Minimum phi angle of run 47 48 fImpactMax=0.0; // Maximum impact parameter 49 fImpactMin=100000.0; // Minimum impact parameter 50 51 fBackTrig=-1.0; // Number of triggers from background 52 fBackSim=-1.0; // Number of simulated showers for the background 53 54 fTriggerRate= -1.0; // Trigger rate in Hz 55 fTriggerRateError= -1.0; // Estimated error for the trigger rate in Hz 55 56 } 56 57 … … 67 68 fFlux0=-1.0; // dn/dE = fFlux0 * E^{-a} 68 69 69 fShowerRate= -1.0; 70 fShowerRateError=0.0; 70 fShowerRate= -1.0; // Showers rate in Hz 71 fShowerRateError=0.0; // Estimated error of shower rate in Hz 71 72 } 72 73 … … 82 83 Init(name, title); 83 84 84 fSpecIndex=0.0; // dn/dE = k * e^{- fSpecIndex}85 fFlux0=-1.0; // dn/dE = fFlux0 * E^{-a}86 87 fShowerRate= showrate; 88 fShowerRateError=sqrt(showrate); 85 fSpecIndex=0.0; // dn/dE = k * e^{- fSpecIndex} 86 fFlux0=-1.0; // dn/dE = fFlux0 * E^{-a} 87 88 fShowerRate= showrate; // Showers rate in Hz 89 fShowerRateError=sqrt(showrate); // Estimated error of shower rate in Hz 89 90 } 90 91 … … 133 134 Float_t phi, Float_t impact) 134 135 { 135 // It updates the limit values 136 137 if (fThetaMax<theta) fThetaMax=theta; 138 if (fThetaMin>theta) fThetaMin=theta; 139 140 if (fPhiMax<phi) fPhiMax=phi; 141 if (fPhiMin>phi) fPhiMin=phi; 142 143 if (fImpactMax<impact) fImpactMax=impact; 144 if (fImpactMin>impact) fImpactMin=impact; 145 146 if (fEnergyMax<energy) fEnergyMax=energy; 147 if (fEnergyMin>energy) fEnergyMin=energy; 148 136 // It updates the limit values 137 138 if (fThetaMax<theta) fThetaMax=theta; 139 if (fThetaMin>theta) fThetaMin=theta; 140 141 if (fPhiMax<phi) fPhiMax=phi; 142 if (fPhiMin>phi) fPhiMin=phi; 143 144 if (fImpactMax<impact) fImpactMax=impact; 145 if (fImpactMin>impact) fImpactMin=impact; 146 147 if (fEnergyMax<energy) fEnergyMax=energy; 148 if (fEnergyMin>energy) fEnergyMin=energy; 149 149 } 150 150 … … 180 180 if(fBackTrig<0){ 181 181 fTriggerRateError = sqrt((trig*fShowerRate*fShowerRate/(simu*simu)) + 182 (anal2*anal2*1/(fBackSim*back2*back2)));182 (anal2*anal2*1/(fBackSim*back2*back2))); 183 183 fBackTrig=0; 184 184 } 185 185 else 186 186 fTriggerRateError = sqrt((trig*fShowerRate*fShowerRate/(simu*simu)) + 187 (anal2*anal2*fBackTrig/(back2*back2)));187 (anal2*anal2*fBackTrig/(back2*back2))); 188 188 189 189 fTriggerRate = trig*fShowerRate/simu + anal2*fBackTrig/back2; … … 205 205 // 206 206 void MHMcRate::Draw(Option_t *) 207 { 208 *fLog << "To be iplemented" << endl; 207 { 208 *fLog << dbginf << "To be iplemented" << endl; 209 } 210 211 TObject *MHMcRate::DrawClone(Option_t *) 212 { 213 *fLog << dbginf << "To be iplemented" << endl; 214 return NULL; 209 215 } -
trunk/MagicSoft/Mars/mhist/MHMcRate.h
r900 r954 56 56 57 57 void Print(Option_t *o=NULL); 58 58 59 void Draw(Option_t *o=NULL); 60 TObject *DrawClone(Option_t *o=NULL); 59 61 60 62 ClassDef(MHMcRate, 1) // Data Container to calculate Collection Area
Note:
See TracChangeset
for help on using the changeset viewer.