Changeset dc883b4 in git
- Timestamp:
- Mar 4, 2021, 2:36:16 PM (4 years ago)
- Branches:
- master
- Children:
- 4658ca4
- Parents:
- f9517a5
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
cards/delphes_card_IDEAtrkCov.tcl
rf9517a5 rdc883b4 8 8 # michele.selvaggi@cern.ch 9 9 ##################################################################### 10 # 10 11 set B 2.0 12 11 13 ####################################### 12 14 # Order of execution of various modules … … 59 61 TreeWriter 60 62 } 61 62 63 63 64 ################################# … … 80 81 81 82 # magnetic field, in T 82 set Bz 2.083 set Bz $B 83 84 } 84 85 … … 310 311 } 311 312 312 set Bz 2.0 313 } 314 313 set Bz $B 314 } 315 315 316 316 ############## … … 767 767 add Branch MissingET/momentum MissingET MissingET 768 768 add Branch ScalarHT/energy ScalarHT ScalarHT 769 } 769 770 # add Info InfoName InfoValue 771 add Info Bz $B 772 } -
classes/DelphesModule.cc
rf9517a5 rdc883b4 130 130 //------------------------------------------------------------------------------ 131 131 132 void DelphesModule::AddInfo(const char *name, Double_t value) 133 { 134 stringstream message; 135 if(!fTreeWriter) 136 { 137 fTreeWriter = static_cast<ExRootTreeWriter *>(GetObject("TreeWriter", ExRootTreeWriter::Class())); 138 if(!fTreeWriter) 139 { 140 message << "can't access access tree writer"; 141 throw runtime_error(message.str()); 142 } 143 } 144 fTreeWriter->AddInfo(name, value); 145 } 146 147 //------------------------------------------------------------------------------ 148 132 149 ExRootResult *DelphesModule::GetPlots() 133 150 { -
classes/DelphesModule.h
rf9517a5 rdc883b4 55 55 56 56 ExRootTreeBranch *NewBranch(const char *name, TClass *cl); 57 void AddInfo(const char *name, Double_t value); 57 58 58 59 ExRootResult *GetPlots(); -
examples/Example6.C
rf9517a5 rdc883b4 64 64 // CEntral track over min Pt 65 65 TH1* histPtgenC = new TH1F("h_PtgenC", "Generated Pt - Central", 500, 0., 50.); // pt for central tracks; 66 TH1* histPtobsC = new TH1F("h_PtobsC", "Reconstructed Pt - Central", 500, 0., 50.); // pt for central 66 TH1* histPtobsC = new TH1F("h_PtobsC", "Reconstructed Pt - Central", 500, 0., 50.); // pt for central 67 67 TH1* histCtgenH = new TH1F("h_CtgenH", "Generateded Cotangent", 100, -10., 10.); // cot(theta) for high pt tracks; 68 68 TH1* histCtobsH = new TH1F("h_CtobsH", "Reconstructed Cotangent", 100, -10., 10.); // cot(theta) for high pt tracks … … 77 77 // 78 78 // Get magnetifc field 79 Double_t Bz = 2.0;79 Double_t Bz = treeReader->GetInfo("Bz"); 80 80 81 81 // Loop over all events … … 107 107 histCtobs->Fill(obsCtg); 108 108 // 109 // Get associated generated particle 109 // Get associated generated particle 110 110 GenParticle* gp = (GenParticle*)trk->Particle.GetObject(); 111 111 // … … 162 162 GenParticle* gpart = (GenParticle*)branchGenPart->At(it); 163 163 // 164 // Plot charged particle parameters 164 // Plot charged particle parameters 165 165 // Only final state particles (Status = 1) 166 166 if (gpart->Status == 1 && TMath::Abs(gpart->Charge) > 0) { … … 290 290 histAccCtgH->Draw(); 291 291 Cnv5->cd(3); gPad->SetLogy(1); 292 histPtgenC->Draw(); 292 histPtgenC->Draw(); 293 293 histPtobsC->SetLineColor(kRed); 294 294 histPtobsC->Draw("SAME"); -
external/ExRootAnalysis/ExRootTreeReader.cc
rf9517a5 rdc883b4 12 12 #include "TBranchElement.h" 13 13 #include "TCanvas.h" 14 #include "TParameter.h" 14 15 #include "TClonesArray.h" 15 16 #include "TH2.h" … … 119 120 //------------------------------------------------------------------------------ 120 121 122 Double_t ExRootTreeReader::GetInfo(const char *name) 123 { 124 TTree *tree = NULL; 125 TParameter<Double_t> *param = NULL; 126 Double_t result = -999.9; 127 if(fChain) tree = fChain->GetTree(); 128 if(tree) param = static_cast<TParameter<Double_t> *>(tree->GetUserInfo()->FindObject(name)); 129 if(param) result = param->GetVal(); 130 return result; 131 } 132 133 //------------------------------------------------------------------------------ 134 121 135 Bool_t ExRootTreeReader::Notify() 122 136 { -
external/ExRootAnalysis/ExRootTreeReader.h
rf9517a5 rdc883b4 29 29 30 30 TClonesArray *UseBranch(const char *branchName); 31 Double_t GetInfo(const char *name); 31 32 32 33 private: -
external/ExRootAnalysis/ExRootTreeWriter.cc
rf9517a5 rdc883b4 11 11 #include "ExRootAnalysis/ExRootTreeBranch.h" 12 12 13 #include "TParameter.h" 13 14 #include "TClonesArray.h" 14 15 #include "TFile.h" … … 48 49 fBranches.insert(branch); 49 50 return branch; 51 } 52 53 //------------------------------------------------------------------------------ 54 55 void ExRootTreeWriter::AddInfo(const char *name, Double_t value) 56 { 57 if(!fTree) fTree = NewTree(); 58 fTree->GetUserInfo()->Add(new TParameter<Double_t>(name, value)); 50 59 } 51 60 -
external/ExRootAnalysis/ExRootTreeWriter.h
rf9517a5 rdc883b4 29 29 30 30 ExRootTreeBranch *NewBranch(const char *name, TClass *cl); 31 void AddInfo(const char *name, Double_t value); 31 32 32 33 void Clear(); -
modules/TreeWriter.cc
rf9517a5 rdc883b4 123 123 fBranchMap.insert(make_pair(branch, make_pair(itClassMap->second, array))); 124 124 } 125 126 param = GetParam("Info"); 127 TString infoName; 128 Double_t infoValue; 129 130 size = param.GetSize(); 131 for(i = 0; i < size / 2; ++i) 132 { 133 infoName = param[i * 2].GetString(); 134 infoValue = param[i * 2 + 1].GetDouble(); 135 136 AddInfo(infoName, infoValue); 137 } 125 138 } 126 139 … … 138 151 it1.Reset(); 139 152 array->Clear(); 140 153 141 154 while((candidate = static_cast<Candidate *>(it1.Next()))) 142 155 { … … 537 550 entry->CtgTheta = ctgTheta; 538 551 entry->C = candidate->C; 539 552 540 553 particle = static_cast<Candidate *>(candidate->GetCandidates()->At(0)); 541 554 const TLorentzVector &initialPosition = particle->Position;
Note:
See TracChangeset
for help on using the changeset viewer.