Changeset 2002 for trunk/MagicSoft
- Timestamp:
- 04/24/03 11:58:54 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2001 r2002 3 3 2003/04/24: Thomas Bretz 4 4 5 * mfilter/MFCT1Supercuts.[h,cc]: 6 - removed 7 8 * manalysis/MPadSchweizer.[h,cc]: 9 - renamed arguments of SetHistograms to Mars style 10 - removed default argument for SetHistograms (usage would result 11 in a crash) 12 - removed empty destructor 13 14 * mhistmc/MHMcTriggerLvl2.h: 15 - removed the wrong f in GetHistf 5 * mfilter/MFCT1Supercuts.[h,cc]: 6 - removed 7 8 * manalysis/MPadSchweizer.[h,cc]: 9 - renamed arguments of SetHistograms to Mars style 10 - removed default argument for SetHistograms (usage would result 11 in a crash) 12 - removed empty destructor 13 14 * mhistmc/MHMcTriggerLvl2.h: 15 - removed the wrong f in GetHistf 16 17 * manalysis/MSigmabarParam.h: 18 - added const qualifiers to getters 19 20 * mfileio/MWriteRootFile.[h,cc]: 21 - fixed support for UPDATE 22 23 * mfilter/MFEnergySlope.cc: 24 - cleaned 25 - removed empty PostProcess 26 27 * mhist/MHCerPhotEvt.cc: 28 - removed ratio from Fill 16 29 17 30 -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
r1664 r2002 208 208 Bool_t MWriteRootFile::GetContainer(MParList *pList) 209 209 { 210 // 211 // loop over all branches which are 'marked' as branches to get written. 212 // 210 213 MRootFileBranch *entry; 211 214 212 //213 // loop over all branches which are 'marked' as branches to get written.214 //215 215 TIter Next(&fBranches); 216 216 while ((entry=(MRootFileBranch*)Next())) … … 274 274 fTrees.AddLast(tree); 275 275 276 // 277 // If the tree does not already exist in the file mark this 278 // tree as a branch created by MWriteRootFile 279 // 280 entry->SetBit(kIsNewTree); 281 276 282 gDirectory = save; 277 283 … … 280 286 281 287 // 288 // In case the file is opened as 'UPDATE' the tree may still not 289 // be in the list. Because it neither was created previously, 290 // nor this time, so the corresponding entries is marked as a 291 // single branch to be filled. --> Add it to the list of trees. 292 // 293 if (!fTrees.FindObject(tree)) 294 fTrees.AddLast(tree); 295 296 // 282 297 // Now we have a valid tree. Search the list of trees for this tree 283 // (either it is already there, or we created and add it previously)284 298 // Add a pointer to the entry in the tree list to this branch-entry 285 299 // 286 TObject *obj; 287 TIter NextTree(&fTrees); 288 while ((obj=NextTree())) 289 { 290 if (obj == tree) 291 entry->SetTree((TTree*)obj); 292 } 300 entry->SetTree(tree); 293 301 294 302 // … … 315 323 branch = tree->Branch(branchname, cont->ClassName(), entry->GetAddress()); 316 324 317 *fLog << "Created Branch " << cname << " of " << cont->ClassName() << "." << endl;318 319 325 // 320 326 // If the branch couldn't be created we have a problem. … … 325 331 return kFALSE; 326 332 } 333 334 // 335 // Tell the entry also which branch belongs to it (this is necessary 336 // for branches belonging to already existing tree, UPDATE-mode) 337 // 338 entry->SetBranch(branch); 339 *fLog << "Created Branch " << cname << " of " << cont->ClassName() << "." << endl; 327 340 } 328 341 return kTRUE; … … 333 346 // Checks all given containers (branch entries) for the write flag. 334 347 // If the write flag is set the corresponding Tree is marked to get filled. 335 // All Trees which are marked to be filled are filled with the corresponding348 // All Trees which are marked to be filled are filled with all their 336 349 // branches. 350 // In case of a file opened in 'UPDATE' mode, single branches can be 351 // filled, too. WARNING - for the moment there is no check whether 352 // you filled the correct number of events into the branch, so that 353 // each of the other branches in the tree has the correct corresponding 354 // number of new entries in the new branch! 337 355 // Be carefull: If only one container (corresponding to a branch) of a tree 338 356 // has the write flag, all containers in this tree are filled! … … 362 380 // the corresponding tree entry. 363 381 // 364 b->GetTree()->SetBit(kFillTree); 382 if (b->TestBit(kIsNewTree)) 383 b->GetTree()->SetBit(kFillTree); 384 else 385 b->GetBranch()->Fill(); 365 386 } 366 387 -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h
r1664 r2002 57 57 void SetContainer(MParContainer *cont) { fContainer = cont; } 58 58 void SetTree(TTree *tree) { fTree = tree; } 59 void SetBranch(TBranch *branch) { fBranch = branch; } 59 60 60 61 ClassDef(MRootFileBranch, 1) // Storage container for MWriteRootFile to store TBranch informations … … 69 70 TObjArray fTrees; //! 70 71 72 //UInt_t fNumEvents; //! Number of events written in a run 73 71 74 void CheckAndWrite() const; 72 75 Bool_t IsFileOpen() const; … … 75 78 76 79 void StreamPrimitive(ofstream &out) const; 80 //Bool_t ReInit(MParList *pList); 81 82 enum { 83 kIsNewTree = BIT(15) 84 }; 77 85 78 86 public: -
trunk/MagicSoft/Mars/mfilter/MFEnergySlope.cc
r1984 r2002 20 20 ! Copyright: MAGIC Software Development, 2000-2003 21 21 ! 22 ! Filter to select events with a energy slope. 02/200323 22 ! 24 23 \* ======================================================================== */ … … 43 42 // // 44 43 // With this filter the statistics of the MC sample is reduced. // 45 // camera ver.0.6 and reflector ver.0.6 are required to fetch //44 // camera ver.0.6 and reflector ver.0.6 are required to fetch // 46 45 // the correct MC information // 47 46 // // … … 49 48 #include "MFEnergySlope.h" 50 49 51 //#include <fstream.h>50 #include <fstream.h> 52 51 #include <TRandom.h> 53 52 … … 56 55 #include "MLog.h" 57 56 #include "MLogManip.h" 58 59 57 60 58 #include "MMcEvt.hxx" … … 73 71 fName = name ? name : "MFEnergySlope"; 74 72 fTitle = title ? title : "Filter to select energy with given slope"; 75 }76 77 // --------------------------------------------------------------------------78 //79 // Destructor80 //81 MFEnergySlope::~MFEnergySlope()82 {83 73 } 84 74 … … 110 100 fMcMaxEnergy = runheader->GetEUppLim(); 111 101 112 *fLog << "MFEnergySlope::PreProcess; fetched MC info:" << endl << 113 " E Slope: "<< fMcSlope << endl << 114 " E Min: "<< fMcMinEnergy << endl << 115 " E Max: "<< fMcMaxEnergy << endl << 116 " New E Slope: "<< fNewSlope << endl; 102 *fLog << inf; 103 *fLog << "MFEnergySlope::PreProcess: fetched MC info:" << endl; 104 *fLog << " E Slope: " << fMcSlope << endl; 105 *fLog << " E Min: " << fMcMinEnergy << endl; 106 *fLog << " E Max: " << fMcMaxEnergy << endl; 107 *fLog << " New E Slope: " << fNewSlope << endl; 117 108 118 109 // Slope is used with positive values in the code … … 180 171 fResult = Nexp > Nrnd; 181 172 182 if (fResult) 183 { 184 fNumSelectedEvts++; 185 return kTRUE; 186 } 187 173 if (!fResult) 174 return kTRUE; 175 176 fNumSelectedEvts++; 188 177 return kTRUE; 189 178 } 190 179 191 192 // --------------------------------------------------------------------------193 //194 // Postprocess all filters.195 //196 Bool_t MFEnergySlope::PostProcess()197 {198 //---------------------------------199 200 return kTRUE;201 }202 203 void MFEnergySlope::StreamPrimitive(ofstream &out) const204 {205 /*206 if (fEvt)207 fEvt->SavePrimitive(out);208 209 out << " MFEnergySlope " << GetUniqueName() << "(";210 211 if (fEvt)212 out << "&" << fEvt->GetUniqueName();213 else214 out << "\"" << fContName << "\"";215 216 out << ", New Energy Slope= " << fValue << " Normalization factor: "217 << fN0 <<" );" << endl;218 */219 }220 221 222 223 224 225 226 227 228 -
trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc
r1990 r2002 131 131 const Int_t id = pix.GetPixId(); 132 132 133 const Double_t ratio = fCam ? fCam->GetPixRatio(id) : 1;134 135 const Double_t val = pix.GetNumPhotons()/ratio;136 137 133 fSum[id].SetPixelUsed(); 138 fSum[id].AddNumPhotons( val);134 fSum[id].AddNumPhotons(pix.GetNumPhotons()); 139 135 } 140 136
Note:
See TracChangeset
for help on using the changeset viewer.