Changeset a7c3c84 in git
- Timestamp:
- Dec 6, 2018, 8:19:22 AM (6 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 92263a8, adde560
- Parents:
- 9047a02 (diff), 0882413 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cards/CMS_PhaseII/CMS_PhaseII_200PU_v03.tcl
r9047a02 ra7c3c84 2280 2280 (abs(eta) > 1.5 && abs(eta) <= 2.0) * (pt > 35.0 && pt <= 50.0) * (0.95) + 2281 2281 (abs(eta) > 1.5 && abs(eta) <= 2.0) * (pt > 50.0 && pt <= 14000.0) * (0.88) + 2282 (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 2.0 && pt <= 4.0) * (0.22) + 2283 (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 4.0 && pt <= 6.0) * (0.36) + 2284 (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 6.0 && pt <= 8.0) * (0.44) + 2285 (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 8.0 && pt <= 10.0) * (0.57) + 2286 (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 10.0 && pt <= 20.0) * (0.63) + 2287 (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 20.0 && pt <= 35.0) * (0.71) + 2288 (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 35.0 && pt <= 50.0) * (0.76) + 2289 (abs(eta) > 2.0 && abs(eta) <= 2.5) * (pt > 50.0 && pt <= 14000.0) * (0.82) + 2290 (abs(eta) > 2.5 && abs(eta) <= 2.8) * (pt > 2.0) * (0.80) + 2282 (abs(eta) > 2.0 && abs(eta) <= 2.8) * (pt > 2.0 && pt <= 4.0) * (0.22) + 2283 (abs(eta) > 2.0 && abs(eta) <= 2.8) * (pt > 4.0 && pt <= 6.0) * (0.36) + 2284 (abs(eta) > 2.0 && abs(eta) <= 2.8) * (pt > 6.0 && pt <= 8.0) * (0.44) + 2285 (abs(eta) > 2.0 && abs(eta) <= 2.8) * (pt > 8.0 && pt <= 10.0) * (0.57) + 2286 (abs(eta) > 2.0 && abs(eta) <= 2.8) * (pt > 10.0 && pt <= 20.0) * (0.63) + 2287 (abs(eta) > 2.0 && abs(eta) <= 2.8) * (pt > 20.0 && pt <= 35.0) * (0.71) + 2288 (abs(eta) > 2.0 && abs(eta) <= 2.8) * (pt > 35.0 && pt <= 50.0) * (0.76) + 2289 (abs(eta) > 2.0 && abs(eta) <= 2.8) * (pt > 50.0 && pt <= 14000.0) * (0.82) + 2291 2290 (abs(eta) > 2.8) * (0.00) 2292 2291 } -
classes/DelphesLHEFReader.cc
r9047a02 ra7c3c84 31 31 #include <iostream> 32 32 #include <sstream> 33 #include <string>34 33 35 34 #include <stdio.h> … … 103 102 int rc, id; 104 103 char *pch; 105 double weight ;104 double weight, xsec; 106 105 107 106 if(!fgets(fBuffer, kBufferSize, fInputFile)) return kFALSE; 108 107 109 // read cross section string from LHE file header (meant to work on Wizard output only)110 if(strstr(fBuffer, "<xsecinfo ") && fEventCounter < 0)111 {112 DelphesStream bufferStream(fBuffer);113 114 string buf = fBuffer;115 string xsecstr="totxsec";116 117 if (buf.find(xsecstr) != string::npos)118 {119 buf = buf.substr(buf.find(xsecstr) + xsecstr.length()+1);120 unsigned first = buf.find_first_of("\"")+1;121 unsigned last = buf.find_last_of("\"");122 xsecstr = buf.substr(first,last-first);123 fCrossSection = stod(xsecstr);124 }125 }126 127 108 if(strstr(fBuffer, "<event>")) 128 109 { … … 130 111 fEventCounter = 1; 131 112 } 132 133 113 else if(fEventCounter > 0) 134 114 { … … 207 187 fWeightList.push_back(make_pair(id, weight)); 208 188 } 189 else if(strstr(fBuffer, "<xsecinfo")) 190 { 191 pch = strstr(fBuffer, "totxsec"); 192 if(!pch) 193 { 194 cerr << "** ERROR: " << "invalid cross section format" << endl; 195 return kFALSE; 196 } 197 198 pch = strpbrk(pch + 1, "\"'"); 199 if(!pch) 200 { 201 cerr << "** ERROR: " << "invalid cross section format" << endl; 202 return kFALSE; 203 } 204 205 DelphesStream xsecStream(pch + 1); 206 rc = xsecStream.ReadDbl(xsec); 207 208 if(!rc) 209 { 210 cerr << "** ERROR: " << "invalid cross section format" << endl; 211 return kFALSE; 212 } 213 214 fCrossSection = xsec; 215 } 209 216 else if(strstr(fBuffer, "</event>")) 210 217 { -
python/DelphesAnalysis/Delphes.py
r9047a02 ra7c3c84 12 12 return theString 13 13 14 _root.MakeRootClass( "Event" ).__str__ = _Event__str__ 14 if hasattr(_root,"MakeRootClass"): 15 _root.MakeRootClass( "Event" ).__str__ = _Event__str__ 16 else: 17 _root.CreateScopeProxy( "Event" ).__str__ = _Event__str__ 15 18 16 19 def _LHCOEvent__str__( self ): … … 18 21 return theString 19 22 20 _root.MakeRootClass( "LHCOEvent" ).__str__ = _LHCOEvent__str__ 23 if hasattr(_root,"MakeRootClass"): 24 _root.MakeRootClass( "LHCOEvent" ).__str__ = _LHCOEvent__str__ 25 else: 26 _root.CreateScopeProxy( "LHCOEvent" ).__str__ = _LHCOEvent__str__ 21 27 22 28 def _LHEFEvent__str__( self ): … … 28 34 return hepmcstr 29 35 30 _root.MakeRootClass( "LHEFEvent" ).__str__ = _LHEFEvent__str__ 36 if hasattr(_root,"MakeRootClass"): 37 _root.MakeRootClass( "LHEFEvent" ).__str__ = _LHEFEvent__str__ 38 else: 39 _root.CreateScopeProxy( "LHEFEvent" ).__str__ = _LHEFEvent__str__ 31 40 32 41 def _HepMCEvent__str__( self ): … … 43 52 return hepmcstr 44 53 45 _root.MakeRootClass( "HepMCEvent" ).__str__ = _HepMCEvent__str__ 54 if hasattr(_root,"MakeRootClass"): 55 _root.MakeRootClass( "HepMCEvent" ).__str__ = _HepMCEvent__str__ 56 else: 57 _root.CreateScopeProxy( "HepMCEvent" ).__str__ = _HepMCEvent__str__ 58 46 59 47 60 def _GenParticle__str__( self ): … … 61 74 return thestring 62 75 63 _root.MakeRootClass( "GenParticle" ).__str__ = _GenParticle__str__ 76 if hasattr(_root,"MakeRootClass"): 77 _root.MakeRootClass( "GenParticle" ).__str__ = _GenParticle__str__ 78 else: 79 _root.CreateScopeProxy( "GenParticle" ).__str__ = _GenParticle__str__ 64 80 65 81 def _GenParticle_printDecay( self, db, particles, pre="" ): … … 71 87 return thestring 72 88 73 _root.MakeRootClass( "GenParticle" ).printDecay = _GenParticle_printDecay 89 if hasattr(_root,"MakeRootClass"): 90 _root.MakeRootClass( "GenParticle" ).printDecay = _GenParticle_printDecay 91 else: 92 _root.CreateScopeProxy( "GenParticle" ).printDecay = _GenParticle_printDecay 74 93 75 94 def _MissingET__str__( self ): … … 77 96 thestring += "Mising energy azimuthal angle: %f\n" % self.Phi 78 97 return thestring 79 80 _root.MakeRootClass( "MissingET" ).__str__ = _MissingET__str__ 98 99 if hasattr(_root,"MakeRootClass"): 100 _root.MakeRootClass( "MissingET" ).__str__ = _MissingET__str__ 101 else: 102 _root.CreateScopeProxy( "MissingET" ).__str__ = _MissingET__str__ 81 103 82 104 def _ScalarHT__str__( self ): 83 105 thestring = "Scalar sum of transverse momenta: %f\n" %self.HT 84 106 85 _root.MakeRootClass( "ScalarHT" ).__str__ = _ScalarHT__str__ 107 if hasattr(_root,"MakeRootClass"): 108 _root.MakeRootClass( "ScalarHT" ).__str__ = _ScalarHT__str__ 109 else: 110 _root.CreateScopeProxy( "ScalarHT" ).__str__ = _ScalarHT__str__ 86 111 87 112 def _Photon__str__( self ): … … 89 114 return thestring 90 115 91 _root.MakeRootClass( "Photon" ).__str__ = _Photon__str__ 116 if hasattr(_root,"MakeRootClass"): 117 _root.MakeRootClass( "Photon" ).__str__ = _Photon__str__ 118 else: 119 _root.CreateScopeProxy( "Photon" ).__str__ = _Photon__str__ 92 120 93 121 def _Electron__str__( self ): … … 96 124 return thestring 97 125 98 _root.MakeRootClass( "Electron" ).__str__ = _Electron__str__ 126 if hasattr(_root,"MakeRootClass"): 127 _root.MakeRootClass( "Electron" ).__str__ = _Electron__str__ 128 else: 129 _root.CreateScopeProxy( "Electron" ).__str__ = _Electron__str__ 99 130 100 131 def _Muon__str__( self ): … … 103 134 return thestring 104 135 105 _root.MakeRootClass( "Muon" ).__str__ = _Muon__str__ 136 if hasattr(_root,"MakeRootClass"): 137 _root.MakeRootClass( "Muon" ).__str__ = _Muon__str__ 138 else: 139 _root.CreateScopeProxy( "Muon" ).__str__ = _Muon__str__ 140 106 141 107 142 def _Jet__str__( self ): … … 126 161 return thestring 127 162 128 _root.MakeRootClass( "Jet" ).__str__ = _Jet__str__ 163 if hasattr(_root,"MakeRootClass"): 164 _root.MakeRootClass( "Jet" ).__str__ = _Jet__str__ 165 else: 166 _root.CreateScopeProxy( "Jet" ).__str__ = _Jet__str__ 129 167 130 168 def _Track__str__( self ): … … 137 175 return thestring 138 176 139 _root.MakeRootClass( "Track" ).__str__ = _Track__str__ 177 if hasattr(_root,"MakeRootClass"): 178 _root.MakeRootClass( "Track" ).__str__ = _Track__str__ 179 else: 180 _root.CreateScopeProxy( "Track" ).__str__ = _Track__str__ 140 181 141 182 def _Tower__str__( self): … … 145 186 return thestring 146 187 147 _root.MakeRootClass( "Tower" ).__str__ = _Tower__str__ 188 if hasattr(_root,"MakeRootClass"): 189 _root.MakeRootClass( "Tower" ).__str__ = _Tower__str__ 190 else: 191 _root.CreateScopeProxy( "Tower" ).__str__ = _Tower__str__ 148 192 149 193 ##################################################### … … 156 200 return theString 157 201 158 _root.MakeRootClass( "TLorentzVector" ).__str__ = _lorentzVector__str__ 159 160 202 if hasattr(_root,"MakeRootClass"): 203 _root.MakeRootClass( "TLorentzVector" ).__str__ = _lorentzVector__str__ 204 else: 205 _root.CreateScopeProxy( "TLorentzVector" ).__str__ = _lorentzVector__str__ 206 207 -
readers/DelphesProIO.cpp
r9047a02 ra7c3c84 57 57 58 58 //--------------------------------------------------------------------------- 59 60 void ConvertInput(proio::Event *event, 59 // This method dynamically checks the message type (varint or not) depending on 60 // non-zero value of units momentumUnit and positionUnit. 61 void ConvertInput(proio::Event *event, double momentumUnit, double positionUnit, 61 62 ExRootTreeBranch *branch, DelphesFactory *factory, 62 63 TObjArray *allParticleOutputArray, TObjArray *stableParticleOutputArray, … … 76 77 pdg = TDatabasePDG::Instance(); 77 78 78 79 79 // event information 80 80 element = static_cast<HepMCEvent *>(branch->NewEntry()); 81 82 81 83 82 int nID=0; … … 99 98 /* 100 99 // Pythia8 specific 101 element->Number = mutableEvent->number();102 element->ProcessID = mutableEvent->process_id();103 100 element->MPI = mutableEvent->mpi(); 104 element->Weight = mutableEvent->weight();105 101 element->Scale = mutableEvent->scale(); 106 102 element->AlphaQED = mutableEvent->alpha_qed(); … … 117 113 element->ReadTime = readStopWatch->RealTime(); 118 114 element->ProcTime = procStopWatch->RealTime(); 115 116 117 118 if ( momentumUnit >0 && positionUnit>0) { 119 120 121 auto entries = event->TaggedEntries("VarintPackedParticles"); 122 123 for (uint64_t entryID : entries) { 124 125 auto mutableParticles = dynamic_cast<model::VarintPackedParticles *>(event->GetEntry(entryID)); 126 127 for(int i = 0; i < mutableParticles->pdg_size(); ++i) 128 { 129 pid = mutableParticles->pdg(i); 130 status = mutableParticles->status(i); 131 px = mutableParticles->px(i)/momentumUnit; 132 py = mutableParticles->py(i)/momentumUnit; 133 pz = mutableParticles->pz(i)/momentumUnit; 134 mass = mutableParticles->mass(i)/momentumUnit; 135 x = mutableParticles->x(i)/positionUnit; 136 y = mutableParticles->y(i)/positionUnit; 137 z = mutableParticles->z(i)/positionUnit; 138 t = mutableParticles->t(i)/positionUnit; 139 140 candidate = factory->NewCandidate(); 141 candidate->PID = pid; 142 pdgCode = TMath::Abs(candidate->PID); 143 candidate->Status = status; 144 candidate->M1 = mutableParticles->parent1(i); 145 candidate->M2 = mutableParticles->parent2(i); 146 candidate->D1 = mutableParticles->child1(i); 147 candidate->D2 = mutableParticles->child2(i); 148 pdgParticle = pdg->GetParticle(pid); 149 candidate->Charge = mutableParticles->charge(i)/3.0; 150 //candidate->Charge = pdgParticle ? Int_t(pdgParticle->Charge()/3.0) : -999; 151 candidate->Mass = mass; 152 candidate->Momentum.SetXYZM(px, py, pz, mass); 153 candidate->Position.SetXYZT(x, y, z, t); 154 allParticleOutputArray->Add(candidate); 155 if(!pdgParticle) continue; 156 157 if(status == 1) 158 { 159 stableParticleOutputArray->Add(candidate); 160 } 161 else if(pdgCode <= 5 || pdgCode == 21 || pdgCode == 15) 162 { 163 partonOutputArray->Add(candidate); 164 } 165 } 166 167 } 168 169 } else { 119 170 120 171 … … 198 249 } 199 250 251 252 } // end particle type 200 253 201 254 } … … 299 352 300 353 auto event = new proio::Event(); 354 355 356 double varint_energy=0; 357 double varint_length=0; 358 359 301 360 auto max_n_events = std::numeric_limits<uint64_t>::max(); 302 361 auto nn = inputFile->Skip(max_n_events); … … 320 379 if(event == 0) continue; 321 380 381 // get metadata 382 if (eventCounter == 0) { 383 auto metadata = event->Metadata(); 384 std::cout << "** INFO: ProIO file metadata:" << std::endl; 385 for (auto element : metadata) { 386 string key=(string)element.first; 387 string value=(string)(*element.second); 388 std::cout << "** INFO: " << key << " = " << value << std::endl; 389 if (key=="info:varint_energy") varint_energy=std::stod(value); 390 if (key=="info:varint_length") varint_length=std::stod(value); 391 } 392 } 393 394 322 395 readStopWatch.Stop(); 323 396 324 397 procStopWatch.Start(); 325 398 326 ConvertInput(event, 399 ConvertInput(event, varint_energy, varint_length, 327 400 branchEvent, factory, 328 401 allParticleOutputArray, stableParticleOutputArray,
Note:
See TracChangeset
for help on using the changeset viewer.