Changeset 1035 for trunk/MagicSoft
- Timestamp:
- 11/06/01 13:44:26 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc
r1017 r1035 43 43 44 44 #include "MPedestalCam.h" 45 #include "MRawRunHeader.h" 45 46 #include "MMcFadcHeader.hxx" 46 47 … … 58 59 Bool_t MMcPedestalCopy::PreProcess(MParList *pList) 59 60 { 60 fMcPedestals = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader"); 61 if (!fMcPedestals) 61 MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 62 if (run) 63 { 64 if (run->GetRunType() != kRTMonteCarlo) 65 return kTRUE; 66 } 67 68 const MMcFadcHeader *mcped = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader"); 69 if (!mcped) 62 70 { 63 71 *fLog << dbginf << "MMcFadcHeader not found... aborting." << endl; … … 65 73 } 66 74 67 fPedestals= (MPedestalCam*)pList->FindCreateObj("MPedestalCam");68 if (! fPedestals)75 MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam"); 76 if (!pedcam) 69 77 return kFALSE; 70 78 71 return kTRUE; 72 } 79 const int num = mcped->GetNumPixel(); 73 80 74 Bool_t MMcPedestalCopy::Process() 75 { 76 const int num = fMcPedestals->GetNumPixel(); 77 78 fPedestals->InitSize(num); 81 pedcam->InitSize(num); 79 82 80 83 for (int i=0; i<num; i++) 81 84 { 82 MPedestalPix &pix = (* fPedestals)[i];85 MPedestalPix &pix = (*pedcam)[i]; 83 86 84 const Float_t pedest = fMcPedestals->GetPedestal(i);85 const Float_t pedrms = fMcPedestals->GetPedestalRms(i);87 const Float_t pedest = mcped->GetPedestal(i); 88 const Float_t pedrms = mcped->GetPedestalRms(i); 86 89 87 90 const Float_t sigma = pedest*sqrt(num); 88 const Float_t sigrms = sigma/sqrt( 2*num);91 const Float_t sigrms = sigma/sqrt(num*2); 89 92 90 93 pix.SetPedestal(pedest, sigma); 91 94 pix.SetPedestalRms(pedrms, sigrms); 92 93 *fLog << pedest << " " << sigma << " " << pedrms << " " << sigrms << endl;94 95 } 95 96 -
trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.h
r1017 r1035 23 23 class MMcPedestalCopy : public MTask 24 24 { 25 const MMcFadcHeader *fMcPedestals; // 26 MPedestalCam *fPedestals; // 27 28 TString *fSrc; 25 TString *fSrc; 29 26 30 27 public: … … 32 29 33 30 Bool_t PreProcess(MParList *pList); 34 Bool_t Process();35 31 36 32 ClassDef(MMcPedestalCopy, 0) // Task which copies the pedestals from the MC into the standard container -
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r1018 r1035 35 35 36 36 #pragma link C++ class MReadTree+; 37 #pragma link C++ class MReadMarsFile+; 37 38 38 39 #pragma link C++ class MRootFileBranch+; -
trunk/MagicSoft/Mars/mbase/MReadTree.cc
r1032 r1035 54 54 #include <fstream.h> 55 55 56 #include <TFile.h> // TFile::GetName 56 57 #include <TChain.h> 57 58 #include <TGProgressBar.h> … … 86 87 fVetoList->SetOwner(); 87 88 89 fNotify = new TOrdCollection; 90 88 91 // 89 92 // open the input stream 90 93 // 91 94 fChain = new TChain(tname); 95 fChain->SetNotify(this); 92 96 93 97 if (fname) … … 115 119 // 116 120 delete fChain; 121 delete fNotify; 117 122 delete fVetoList; 123 } 124 125 void MReadTree::SetOwner(Bool_t flag) 126 { 127 flag ? fNotify->SetBit(kIsOwner) : fNotify->ResetBit(kIsOwner); 128 } 129 130 Bool_t MReadTree::Notify() 131 { 132 fNotify->ForEach(TObject, Notify)(); 133 return kTRUE; 118 134 } 119 135 … … 464 480 fVetoList->Add(branch); 465 481 } 482 483 const char *MReadTree::GetFileName() const 484 { 485 return fChain->GetFile()->GetName(); 486 } 487 488 void MReadTree::AddNotify(TObject *obj) 489 { 490 fNotify->Add(obj); 491 } -
trunk/MagicSoft/Mars/mbase/MReadTree.h
r1030 r1035 22 22 23 23 TOrdCollection *fVetoList; // List of Branches which are not allowed to get enabled 24 TOrdCollection *fNotify; // List of TObjects to notify when switching files 24 25 25 26 TGProgressBar *fProgress; // Possible display of status … … 32 33 void EnableBranchChoosing(); 33 34 34 Bool_t PreProcess(MParList *pList); 35 Bool_t Process(); 36 35 enum { kIsOwner = BIT(14) }; 36 37 37 public: 38 38 MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL); 39 39 ~MReadTree(); 40 40 41 Int_t AddFile(const char *fname);42 41 void DisableAutoScheme() { fAutoEnable = kFALSE; } 43 42 void EnableBranch(const char *name); … … 55 54 UInt_t GetEntries() const { return fNumEntries; } 56 55 56 const char *GetFileName() const; 57 58 virtual void AddNotify(TObject *obj); 59 virtual void SetOwner(Bool_t flag=kTRUE); 60 61 virtual Int_t AddFile(const char *fname); 62 63 virtual Bool_t PreProcess(MParList *pList); 64 virtual Bool_t Process(); 65 66 virtual Bool_t Notify(); 67 57 68 ClassDef(MReadTree, 0) // Reads a tree from file(s) 58 69 }; -
trunk/MagicSoft/Mars/mbase/Makefile
r1018 r1035 40 40 MEvtLoop.cc \ 41 41 MReadTree.cc \ 42 MReadMarsFile.cc \ 42 43 MWriteFile.cc \ 43 44 MWriteAsciiFile.cc \
Note:
See TracChangeset
for help on using the changeset viewer.