Changeset 861 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 07/10/01 12:41:13 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHMcEnergies.cc
r859 r861 23 23 \* ======================================================================== */ 24 24 25 ///////////////////////////////////////////////////////////////////////////// 26 // 27 // MHMcEnergies 28 // 29 // This class holds and array of MHMcEnergy objects in order to be able 30 // to compute the threshold for each of the different trigger conditions 31 // in a root file. 32 // 33 //////////////////////////////////////////////////////////////////////////// 25 34 #include "MHMcEnergies.h" 26 35 … … 30 39 ClassImp(MHMcEnergies); 31 40 41 // -------------------------------------------------------------------------- 42 // 43 // Default Constructor. 44 // 32 45 MHMcEnergies::MHMcEnergies(const UInt_t count, const char *name, const char *title) 33 46 : fNum(count) 34 47 { 35 //36 // default constructor37 //38 48 char aux[25]="MHMcEnergies"; 39 49 sprintf(aux+12, "[%i]", fNum); … … 48 58 } 49 59 60 // -------------------------------------------------------------------------- 61 // 62 // Default Destructor. 63 // 50 64 MHMcEnergies::~MHMcEnergies() 51 65 { 52 66 delete fHists; 53 67 } 54 68 // -------------------------------------------------------------------------- 69 // 70 // Add to the parameter list all the MHMcEnergy objects contained in the array. 71 // 55 72 void MHMcEnergies::AddEntriesToList(MParList *plist) 56 73 { -
trunk/MagicSoft/Mars/mhist/MHMcEnergies.h
r855 r861 20 20 { 21 21 private: 22 UInt_t fNum; 23 TClonesArray *fHists; // histograms22 UInt_t fNum; // Num of histograms 23 TClonesArray *fHists; // Array with the energy histograms 24 24 25 25 public: … … 36 36 37 37 #endif 38 -
trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc
r859 r861 23 23 \* ======================================================================== */ 24 24 25 ///////////////////////////////////////////////////////////////////////////// 26 // 27 // MHMcEnergy 28 // 29 // This class holds the information ( histogram and fit function ) 30 // about the energy threshold for a particular trigger condition. 31 // 32 //////////////////////////////////////////////////////////////////////////// 25 33 #include "MHMcEnergy.h" 26 34 … … 34 42 ClassImp(MHMcEnergy); 35 43 44 // ------------------------------------------------------------------------- 45 // 46 // Default Constructor. 47 // 36 48 MHMcEnergy::MHMcEnergy(const UInt_t idx, const char *name, const char *title) 37 49 { 38 //39 // default constructor40 //41 50 char aux[15]="MHMcEnergy"; 42 51 … … 58 67 if (idx>0) 59 68 sprintf(aux+10, ";%i", idx); 60 hLogEner = new TH1F(aux, "", 100, 0.5, 4.5);69 hLogEner = new TH1F(aux, "", 40, 0.5, 4.5); 61 70 hLogEner->SetXTitle("log(E) [GeV]"); 62 71 hLogEner->SetYTitle("dN/dE"); 63 //hLogEner->SetBins(60);64 72 } 65 73 74 //------------------------------------------------------------------------- 75 // 76 // Defualt Destructor 77 // 66 78 MHMcEnergy::~MHMcEnergy() 67 79 { … … 70 82 } 71 83 84 //-------------------------------------------------------------------------- 85 // 86 // Fill the histogram with the log10 of the energy for triggered events. 87 // 72 88 void MHMcEnergy::Fill(Float_t log10E, Float_t w) 73 89 { … … 75 91 } 76 92 93 // ------------------------------------------------------------------------- 94 // 95 // Fitting function 96 // 77 97 void MHMcEnergy::Fit(Axis_t xxmin, Axis_t xxmax) 78 98 { 79 99 // 80 100 // 0: don't draw the function (it is drawn together with the histogram) 81 // +: add these function to the list of fits. Don't delete the last fit.101 // Q: quiet mode 82 102 // 83 // FIXME: R means: use the range specified in the function (xxmin, xxmax are ignored!) 84 // Q means: quiet (why?) 85 // 86 // 87 hLogEner->Fit(fLogEner->GetName(), "Q0+", "", xxmin, xxmax); 103 hLogEner->Fit(fLogEner->GetName(), "Q0", "", xxmin, xxmax); 88 104 } 89 105 106 // ------------------------------------------------------------------------ 107 // 108 // Drawing function. It creates its own canvas. 109 // 90 110 void MHMcEnergy::Draw(Option_t *option) 91 111 { … … 111 131 } 112 132 133 // -------------------------------------------------------------------------- 134 // 135 // Set the number of bins in the histogran. 136 // 137 void MHMcEnergy::SetBins(Int_t nbins) 138 { 139 hLogEner->SetBins(nbins,0.5,4.5); 140 } 141 // -------------------------------------------------------------------------- 142 // 143 // Write the threshold and its error in the standard output 144 // 113 145 void MHMcEnergy::Print(Option_t*) 114 146 { … … 116 148 } 117 149 150 // ------------------------------------------------------------------------- 151 // 152 // Return the threshold 153 // 118 154 Float_t MHMcEnergy::GetThreshold() const 119 155 { … … 123 159 } 124 160 161 // ------------------------------------------------------------------------- 162 // 163 // Return the error of the threshold. 164 // 125 165 Float_t MHMcEnergy::GetThresholdErr() const 126 166 { … … 129 169 const Float_t p1err = fLogEner->GetParError(1); 130 170 171 // The error has into accuont the error in the fit 131 172 return pow(10, p1) * p1err * lg10; 132 173 } 133 174 175 // ------------------------------------------------------------------------- 176 // 177 // Return the peak of the fitted gaussan function. 178 // 134 179 Float_t MHMcEnergy::GetGaussPeak() const 135 180 { … … 137 182 } 138 183 184 // ------------------------------------------------------------------------- 185 // 186 // Return the sigma of the fitted gaussan function. 187 // 139 188 Float_t MHMcEnergy::GetGaussSigma() const 140 189 { … … 142 191 } 143 192 193 194 195 -
trunk/MagicSoft/Mars/mhist/MHMcEnergy.h
r851 r861 32 32 void Fill(Float_t log10E, Float_t w); 33 33 void Fit(Axis_t xxmin, Axis_t xxmax); 34 void SetBins(Int_t nbins = 100); 34 35 35 36 void Draw(Option_t* option = ""); 36 37 void Print(Option_t* option = NULL); 37 38 38 ClassDef(MHMcEnergy, 1) // Histogram container for montecarlo energy 39 ClassDef(MHMcEnergy, 1) // Histogram container for montecarlo energy threshold 39 40 }; 40 41
Note:
See TracChangeset
for help on using the changeset viewer.