Changeset 2251 for trunk/MagicSoft
- Timestamp:
- 06/30/03 10:55:30 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2250 r2251 1 1 -*-*- END OF LINE -*-*- 2 2 3 2003/06/30: Thomas Bretz 4 5 * macros/pixfirerate.C: 6 - changed to new style 7 8 * manalysis/MCerPhotCalc.cc: 9 - scale weight so that sum=1 10 11 * mhist/MHCamera.h: 12 - small change 13 14 15 3 16 2003/06/27: Abelardo Moralejo 4 17 5 * mmontecarlo/MMcCollectionAreaCalc.[h,cc]: 6 * mhistmc/MHMcCollectionAreaCalc.[h,cc]: 7 18 * mmontecarlo/MMcCollectionAreaCalc.[h,cc], 19 mhistmc/MHMcCollectionAreaCalc.[h,cc]: 8 20 - Adapted to allow their use with multiple files containing 9 21 MC data generated with diffferent energy spectra, even with … … 13 25 is done by CalcEfficiency2(). Some simplifications and cleaning 14 26 are still possible. 27 28 15 29 16 30 2003/06/27: Thomas Bretz -
trunk/MagicSoft/Mars/macros/pixfirerate.C
r2162 r2251 36 36 ///////////////////////////////////////////////////////////////////////////// 37 37 38 void pixfirerate(TString filename=" 20030603_01731_D_cosmics_E.root")38 void pixfirerate(TString filename="rawfile.root") 39 39 { 40 40 // … … 57 57 // The tasklist is identified in the eventloop by its name 58 58 // 59 MTaskList tlist; 59 60 MParList plist; 60 MTaskList tlist;61 61 plist.AddToList(&tlist); 62 62 … … 73 73 MReadMarsFile read("Events"); 74 74 read.DisableAutoScheme(); 75 read.AddFile(filename); 76 tlist.AddToList(&read); 75 77 76 MHTrigLvl0 trigmap1(10.,"Above 10"); 77 MHTrigLvl0 trigmap2(20.,"Above 20"); 78 MHTrigLvl0 trigmap3(50.,"Above 50"); 79 MHTrigLvl0 trigmap4(100.,"Above 100"); 80 MHTrigLvl0 trigmap5(200.,"Above 200"); 78 Double_t threshold[] = { 10, 20, 100, 200, -1 }; 81 79 82 plist.AddToList(&trigmap1); 83 plist.AddToList(&trigmap2); 84 plist.AddToList(&trigmap3); 85 plist.AddToList(&trigmap4); 86 plist.AddToList(&trigmap5); 80 Int_t cnt = 0; 81 while (threshold[cnt]>0) cnt++; 87 82 88 MFillH fill1("Above 10","MRawEvtData"); 89 MFillH fill2("Above 20","MRawEvtData"); 90 MFillH fill3("Above 50","MRawEvtData"); 91 MFillH fill4("Above 100","MRawEvtData"); 92 MFillH fill5("Above 200","MRawEvtData"); 83 for (int i=0; i<cnt; i++) 84 { 85 TString name = "Above "; 86 TString num; 87 num += threshold[i]; 88 name += num.Strip(TString::kBoth); 89 TString title = "Firerate [%] of pixels with signal > "; 90 title += num.Strip(TString::kBoth); 93 91 94 read.AddFile(filename); 95 96 tlist.AddToList(&read); 97 tlist.AddToList(&fill1); 98 tlist.AddToList(&fill2); 99 tlist.AddToList(&fill3); 100 tlist.AddToList(&fill4); 101 tlist.AddToList(&fill5); 92 MHTriggerLvl0 *trigmap = new MHTriggerLvl0(threshold[i], name, title); 93 MFillH *fillh = new MFillH(trigmap, "MRawEvtData"); 94 trigmap->SetBit(kCanDelete); 95 fillh->SetBit(kCanDelete); 96 plist.AddToList(trigmap); 97 tlist.AddToList(fillh); 98 } 102 99 103 100 MEvtLoop evtloop; -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
r2237 r2251 117 117 118 118 // Calculate quadratic sum of weights: 119 fSumWeights = 0; 119 Doubla_t sum = 0; 120 120 121 fSumQuadWeights = 0; 121 122 for (Int_t i=0; i<fWeight.GetSize(); i++) 122 { 123 fSumWeights += fWeight[i]; 123 sum += fWeight[i]; 124 125 for (Int_t i=0; i<fWeight.GetSize(); i++) 126 { 127 fWeight[i] /= sum; 124 128 fSumQuadWeights += fWeight[i]*fWeight[i]; 125 129 } 126 127 fSumQuadWeights = sqrt(fSumQuadWeights);128 130 129 131 return kTRUE; … … 180 182 181 183 const Double_t offset = fEnableFix ? ped.GetPedestal()-0.5 : ped.GetPedestal(); 182 ped.Set(offset *fSumWeights, ped.GetPedestalRms()*fSumQuadWeights);184 ped.Set(offset, ped.GetPedestalRms()*sqrt(fSumQuadWeights)); 183 185 } 184 186 … … 195 197 //fCerPhotEvt->InitSize(fRawEvt->GetNumPixels()); 196 198 197 if (fIsMcFile)198 ScalePedestals();199 // if (fIsMcFile) 200 // ScalePedestals(); 199 201 200 202 MRawEvtPixelIter pixel(fRawEvt); -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.h
r2237 r2251 34 34 35 35 TArrayF fWeight; // Weights for adding up the ADC slices 36 Float_t fSumWeights;37 36 Float_t fSumQuadWeights; 38 37 -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r2244 r2251 93 93 virtual void SetCamContent(const MCamEvent &evt, Int_t type=0) { Reset(); AddCamContent(evt, type); } 94 94 virtual void SetCamContent(const TArrayD &evt, const TArrayC *used=NULL) { Reset(); AddCamContent(evt, used); } 95 virtual void SetCamContent(const MHCamera &d, Int_t type=0) { Reset(); fEntries=d.fEntries-1; AddCamContent(d, type); }95 virtual void SetCamContent(const MHCamera &d, Int_t type=0) { Reset(); AddCamContent(d, type); fEntries=d.fEntries; } 96 96 virtual void CntCamContent(const MCamEvent &evt, Double_t threshold, Int_t type=0); 97 97 virtual void CntCamContent(const TArrayD &evt, Double_t threshold, Bool_t ispos=kTRUE);
Note:
See TracChangeset
for help on using the changeset viewer.