- Timestamp:
- Feb 12, 2019, 9:29:17 PM (6 years ago)
- Branches:
- ImprovedOutputFile, Timing, llp, master
- Children:
- 6455202
- Parents:
- 45e58be
- Location:
- classes
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
classes/DelphesClasses.cc
r45e58be r341014c 16 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 17 */ 18 19 18 20 19 /** … … 133 132 Area(0.0, 0.0, 0.0, 0.0), 134 133 L(0), 135 D0(0), ErrorD0(0), 136 DZ(0), ErrorDZ(0), 137 P(0), ErrorP(0),138 PT(0), ErrorPT(0), 139 CtgTheta(0), ErrorCtgTheta(0), 140 Phi(0), ErrorPhi(0), 141 Xd(0), Yd(0), Zd(0), 134 D0(0), ErrorD0(0), 135 DZ(0), ErrorDZ(0), 136 P(0), ErrorP(0), 137 PT(0), ErrorPT(0), 138 CtgTheta(0), ErrorCtgTheta(0), 139 Phi(0), ErrorPhi(0), 140 Xd(0), Yd(0), Zd(0), 142 141 TrackResolution(0), 143 142 NCharged(0), … … 236 235 return kFALSE; 237 236 } 238 239 237 240 238 //------------------------------------------------------------------------------ … … 304 302 object.PT = PT; 305 303 object.ErrorPT = ErrorPT; 306 object.CtgTheta = CtgTheta 304 object.CtgTheta = CtgTheta; 307 305 object.ErrorCtgTheta = ErrorCtgTheta; 308 306 object.Phi = Phi; 309 object.ErrorPhi = ErrorPhi; 307 object.ErrorPhi = ErrorPhi; 310 308 object.Xd = Xd; 311 309 object.Yd = Yd; … … 327 325 object.ClusterIndex = ClusterIndex; 328 326 object.ClusterNDF = ClusterNDF; 329 object.ClusterSigma = ClusterSigma; 327 object.ClusterSigma = ClusterSigma; 330 328 object.SumPT2 = SumPT2; 331 329 332 330 object.FracPt[0] = FracPt[0]; 333 331 object.FracPt[1] = FracPt[1]; … … 361 359 object.NSubJetsSoftDropped = NSubJetsSoftDropped; 362 360 363 object.SoftDroppedJet = SoftDroppedJet;361 object.SoftDroppedJet = SoftDroppedJet; 364 362 object.SoftDroppedSubJet1 = SoftDroppedSubJet1; 365 363 object.SoftDroppedSubJet2 = SoftDroppedSubJet2; … … 384 382 //------------------------------------------------------------------------------ 385 383 386 void Candidate::Clear(Option_t *option)384 void Candidate::Clear(Option_t *option) 387 385 { 388 386 int i; … … 391 389 PID = 0; 392 390 Status = 0; 393 M1 = -1; M2 = -1; D1 = -1; D2 = -1; 391 M1 = -1; 392 M2 = -1; 393 D1 = -1; 394 D2 = -1; 394 395 Charge = 0; 395 396 Mass = 0.0; … … 420 421 L = 0.0; 421 422 ErrorT = 0.0; 422 D0 = 0.0; 423 D0 = 0.0; 423 424 ErrorD0 = 0.0; 424 425 DZ = 0.0; 425 426 ErrorDZ = 0.0; 426 P = 0.0;427 ErrorP = 0.0;427 P = 0.0; 428 ErrorP = 0.0; 428 429 PT = 0.0; 429 430 ErrorPT = 0.0; … … 455 456 ClusterIndex = -1; 456 457 ClusterNDF = -99; 457 ClusterSigma = 0.0; 458 ClusterSigma = 0.0; 458 459 SumPT2 = 0.0; 459 460 BTVSumPT2 = 0.0; 460 461 GenDeltaZ = 0.0; 461 GenSumPT2 = 0.0; 462 462 GenSumPT2 = 0.0; 463 463 464 FracPt[0] = 0.0; 464 465 FracPt[1] = 0.0; … … 476 477 SoftDroppedSubJet2.SetXYZT(0.0, 0.0, 0.0, 0.0); 477 478 478 479 479 for(i = 0; i < 5; ++i) 480 480 { -
classes/DelphesClasses.h
r45e58be r341014c 32 32 // Dependencies (#includes) 33 33 34 #include "TLorentzVector.h" 35 #include "TObject.h" 34 36 #include "TRef.h" 35 #include "TObject.h"36 37 #include "TRefArray.h" 37 #include "TLorentzVector.h"38 38 39 39 #include "classes/SortableObject.h" … … 46 46 { 47 47 public: 48 49 48 Long64_t Number; // event number 50 49 … … 60 59 { 61 60 public: 62 63 61 Int_t Trigger; // trigger word 64 62 … … 71 69 { 72 70 public: 73 74 71 Int_t ProcessID; // subprocess code for the event | hepup.IDPRUP 75 72 … … 99 96 { 100 97 public: 101 102 98 Int_t ProcessID; // unique signal process id | signal_process_id() 103 99 Int_t MPI; // number of multi parton interactions | mpi () … … 121 117 Float_t PDF1; // PDF (id1, x1, Q) | pdf_info()->pdf1() 122 118 Float_t PDF2; // PDF (id2, x2, Q) | pdf_info()->pdf2() 123 124 125 119 126 120 ClassDef(HepMCEvent, 3) … … 181 175 { 182 176 public: 183 184 177 Float_t T; // vertex position (t component) 185 178 Float_t X; // vertex position (x component) … … 260 253 { 261 254 public: 262 263 255 Float_t PT; // photon transverse momentum 264 256 Float_t Eta; // photon pseudorapidity … … 295 287 { 296 288 public: 297 298 289 Float_t PT; // electron transverse momentum 299 290 Float_t Eta; // electron pseudorapidity … … 333 324 { 334 325 public: 335 336 326 Float_t PT; // muon transverse momentum 337 327 Float_t Eta; // muon pseudorapidity … … 369 359 { 370 360 public: 371 372 361 Float_t PT; // jet transverse momentum 373 362 Float_t Eta; // jet pseudorapidity … … 378 367 Float_t Mass; // jet invariant mass 379 368 380 Float_t DeltaEta; 381 Float_t DeltaPhi; 369 Float_t DeltaEta; // jet radius in pseudorapidity 370 Float_t DeltaPhi; // jet radius in azimuthal angle 382 371 383 372 UInt_t Flavor; // jet flavor … … 414 403 TLorentzVector SoftDroppedP4[5]; // first entry (i = 0) is the total SoftDropped Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta 415 404 416 417 405 Int_t NSubJetsTrimmed; // number of subjets trimmed 418 406 Int_t NSubJetsPruned; // number of subjets pruned … … 423 411 Double_t ExclYmerge45; 424 412 Double_t ExclYmerge56; 425 413 426 414 TRefArray Constituents; // references to constituents 427 415 TRefArray Particles; // references to generated particles … … 626 614 627 615 Int_t NTimeHits; 628 std::vector< std::pair< Float_t, Float_t >> ECalEnergyTimePairs;616 std::vector<std::pair<Float_t, Float_t>> ECalEnergyTimePairs; 629 617 630 618 // Isolation variables … … 670 658 Double_t ExclYmerge45; 671 659 Double_t ExclYmerge56; 672 660 673 661 static CompBase *fgCompare; //! 674 662 const CompBase *GetCompare() const { return fgCompare; } … … 681 669 virtual void Copy(TObject &object) const; 682 670 virtual TObject *Clone(const char *newname = "") const; 683 virtual void Clear(Option_t *option = "");671 virtual void Clear(Option_t *option = ""); 684 672 685 673 private: … … 693 681 694 682 #endif // DelphesClasses_h 695 696 -
classes/DelphesCylindricalFormula.cc
r45e58be r341014c 16 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 17 */ 18 19 18 20 19 #include "classes/DelphesCylindricalFormula.h" … … 54 53 for(it = expression; *it; ++it) 55 54 { 56 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' 55 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\') continue; 57 56 buffer.Append(*it); 58 57 } -
classes/DelphesCylindricalFormula.h
r45e58be r341014c 25 25 { 26 26 public: 27 28 27 DelphesCylindricalFormula(); 29 28 … … 38 37 39 38 #endif /* DelphesCylindricalFormula_h */ 40 -
classes/DelphesFactory.cc
r45e58be r341014c 16 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 17 */ 18 19 18 20 19 /** \class DelphesFactory … … 51 50 if(fObjArrays) delete fObjArrays; 52 51 53 map< const TClass*, ExRootTreeBranch*>::iterator itBranches;52 map<const TClass *, ExRootTreeBranch *>::iterator itBranches; 54 53 for(itBranches = fBranches.begin(); itBranches != fBranches.end(); ++itBranches) 55 54 { 56 delete 55 delete(itBranches->second); 57 56 } 58 57 } … … 60 59 //------------------------------------------------------------------------------ 61 60 62 void DelphesFactory::Clear(Option_t *option)61 void DelphesFactory::Clear(Option_t *option) 63 62 { 64 63 set<TObject *>::iterator itPool; … … 70 69 TProcessID::SetObjectCount(0); 71 70 72 map< const TClass*, ExRootTreeBranch*>::iterator itBranches;71 map<const TClass *, ExRootTreeBranch *>::iterator itBranches; 73 72 for(itBranches = fBranches.begin(); itBranches != fBranches.end(); ++itBranches) 74 73 { … … 120 119 121 120 //------------------------------------------------------------------------------ 122 -
classes/DelphesFactory.h
r45e58be r341014c 42 42 { 43 43 public: 44 45 44 DelphesFactory(const char *name = "ObjectFactory"); 46 45 ~DelphesFactory(); 47 46 48 virtual void Clear(Option_t *option = "");49 47 virtual void Clear(Option_t *option = ""); 48 50 49 TObjArray *NewPermanentArray(); 51 50 … … 56 55 TObject *New(TClass *cl); 57 56 58 template <typename T>57 template <typename T> 59 58 T *New() { return static_cast<T *>(New(T::Class())); } 60 59 61 60 private: 62 63 61 ExRootTreeBranch *fObjArrays; //! 64 62 65 63 #if !defined(__CINT__) && !defined(__CLING__) 66 std::map< const TClass*, ExRootTreeBranch*> fBranches; //!64 std::map<const TClass *, ExRootTreeBranch *> fBranches; //! 67 65 #endif 68 66 69 std::set< TObject*> fPool; //!70 67 std::set<TObject *> fPool; //! 68 71 69 ClassDef(DelphesFactory, 1) 72 70 }; 73 71 74 72 #endif /* DelphesFactory */ 75 -
classes/DelphesFormula.cc
r45e58be r341014c 16 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 17 */ 18 19 18 20 19 #include "classes/DelphesFormula.h" … … 54 53 for(it = expression; *it; ++it) 55 54 { 56 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' 55 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\') continue; 57 56 buffer.Append(*it); 58 57 } … … 62 61 buffer.ReplaceAll("energy", "t"); 63 62 63 #if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0) 64 TFormula::SetMaxima(100000, 1000, 1000000); 65 #endif 64 66 65 66 #if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)67 TFormula::SetMaxima(100000,1000,1000000);68 #endif69 70 67 if(TFormula::Compile(buffer) != 0) 71 68 { … … 79 76 Double_t DelphesFormula::Eval(Double_t pt, Double_t eta, Double_t phi, Double_t energy) 80 77 { 81 82 78 Double_t x[4] = {pt, eta, phi, energy}; 79 return EvalPar(x); 83 80 } 84 81 -
classes/DelphesFormula.h
r45e58be r341014c 25 25 { 26 26 public: 27 28 27 DelphesFormula(); 29 28 … … 38 37 39 38 #endif /* DelphesFormula_h */ 40 -
classes/DelphesHepMCReader.cc
r45e58be r341014c 17 17 */ 18 18 19 20 19 /** \class DelphesHepMCReader 21 20 * … … 28 27 #include "classes/DelphesHepMCReader.h" 29 28 30 #include <stdexcept>31 29 #include <iostream> 32 30 #include <sstream> 31 #include <stdexcept> 33 32 34 33 #include <map> … … 37 36 #include <stdio.h> 38 37 38 #include "TDatabasePDG.h" 39 #include "TLorentzVector.h" 39 40 #include "TObjArray.h" 41 #include "TParticlePDG.h" 40 42 #include "TStopwatch.h" 41 #include "TDatabasePDG.h"42 #include "TParticlePDG.h"43 #include "TLorentzVector.h"44 43 45 44 #include "classes/DelphesClasses.h" … … 111 110 TObjArray *partonOutputArray) 112 111 { 113 map< int, pair< int, int >>::iterator itMotherMap;114 map< int, pair< int, int >>::iterator itDaughterMap;112 map<int, pair<int, int>>::iterator itMotherMap; 113 map<int, pair<int, int>>::iterator itDaughterMap; 115 114 char key, momentumUnit[4], positionUnit[3]; 116 115 int i, rc, state; … … 141 140 if(!rc) 142 141 { 143 cerr << "** ERROR: " << "invalid event format" << endl; 142 cerr << "** ERROR: " 143 << "invalid event format" << endl; 144 144 return kFALSE; 145 145 } … … 155 155 if(!rc) 156 156 { 157 cerr << "** ERROR: " << "invalid event format" << endl; 157 cerr << "** ERROR: " 158 << "invalid event format" << endl; 158 159 return kFALSE; 159 160 } … … 167 168 if(!rc) 168 169 { 169 cerr << "** ERROR: " << "invalid event format" << endl; 170 cerr << "** ERROR: " 171 << "invalid event format" << endl; 170 172 return kFALSE; 171 173 } … … 177 179 if(rc != 2) 178 180 { 179 cerr << "** ERROR: " << "invalid units format" << endl; 181 cerr << "** ERROR: " 182 << "invalid units format" << endl; 180 183 return kFALSE; 181 184 } … … 189 192 fMomentumCoefficient = 0.001; 190 193 } 191 194 192 195 if(strncmp(positionUnit, "MM", 3) == 0) 193 196 { … … 199 202 } 200 203 } 201 204 202 205 else if(key == 'C') 203 206 { … … 205 208 && bufferStream.ReadDbl(fCrossSectionError); 206 209 } 207 210 208 211 else if(key == 'F') 209 212 { … … 218 221 if(!rc) 219 222 { 220 cerr << "** ERROR: " << "invalid PDF format" << endl; 223 cerr << "** ERROR: " 224 << "invalid PDF format" << endl; 221 225 return kFALSE; 222 226 } … … 235 239 if(!rc) 236 240 { 237 cerr << "** ERROR: " << "invalid vertex format" << endl; 241 cerr << "** ERROR: " 242 << "invalid vertex format" << endl; 238 243 return kFALSE; 239 244 } … … 256 261 if(!rc) 257 262 { 258 cerr << "** ERROR: " << "invalid particle format" << endl; 263 cerr << "** ERROR: " 264 << "invalid particle format" << endl; 259 265 return kFALSE; 260 266 } … … 345 351 { 346 352 Weight *element; 347 vector< double>::const_iterator itWeight;353 vector<double>::const_iterator itWeight; 348 354 349 355 for(itWeight = fWeight.begin(); itWeight != fWeight.end(); ++itWeight) … … 374 380 375 381 pdgParticle = fPDG->GetParticle(fPID); 376 candidate->Charge = pdgParticle ? int(pdgParticle->Charge() /3.0) : -999;382 candidate->Charge = pdgParticle ? int(pdgParticle->Charge() / 3.0) : -999; 377 383 candidate->Mass = fMass; 378 384 … … 427 433 { 428 434 Candidate *candidate; 429 map< int, pair< int, int >>::iterator itMotherMap;430 map< int, pair< int, int >>::iterator itDaughterMap;435 map<int, pair<int, int>>::iterator itMotherMap; 436 map<int, pair<int, int>>::iterator itDaughterMap; 431 437 int i; 432 438 -
classes/DelphesHepMCReader.h
r45e58be r341014c 42 42 { 43 43 public: 44 45 44 DelphesHepMCReader(); 46 45 ~DelphesHepMCReader(); … … 62 61 63 62 private: 64 65 63 void AnalyzeParticle(DelphesFactory *factory, 66 64 TObjArray *allParticleOutputArray, … … 82 80 83 81 int fStateSize; 84 std::vector< int> fState;82 std::vector<int> fState; 85 83 86 84 int fWeightSize; 87 std::vector< double> fWeight;85 std::vector<double> fWeight; 88 86 89 87 double fCrossSection, fCrossSectionError; … … 100 98 int fParticleCounter; 101 99 102 std::map< int, std::pair < int, int >> fMotherMap;103 std::map< int, std::pair < int, int >> fDaughterMap;100 std::map<int, std::pair<int, int>> fMotherMap; 101 std::map<int, std::pair<int, int>> fDaughterMap; 104 102 }; 105 103 106 104 #endif // DelphesHepMCReader_h 107 108 -
classes/DelphesLHEFReader.cc
r45e58be r341014c 17 17 */ 18 18 19 20 19 /** \class DelphesLHEFReader 21 20 * … … 28 27 #include "classes/DelphesLHEFReader.h" 29 28 30 #include <stdexcept>31 29 #include <iostream> 32 30 #include <sstream> 31 #include <stdexcept> 33 32 34 33 #include <stdio.h> 35 34 35 #include "TDatabasePDG.h" 36 #include "TLorentzVector.h" 36 37 #include "TObjArray.h" 38 #include "TParticlePDG.h" 37 39 #include "TStopwatch.h" 38 #include "TDatabasePDG.h"39 #include "TParticlePDG.h"40 #include "TLorentzVector.h"41 40 42 41 #include "classes/DelphesClasses.h" … … 54 53 DelphesLHEFReader::DelphesLHEFReader() : 55 54 fInputFile(0), fBuffer(0), fPDG(0), 56 fEventReady(kFALSE), fEventCounter(-1), fParticleCounter(-1), 55 fEventReady(kFALSE), fEventCounter(-1), fParticleCounter(-1), fCrossSection(1) 57 56 58 57 { … … 124 123 if(!rc) 125 124 { 126 cerr << "** ERROR: " << "invalid event format" << endl; 125 cerr << "** ERROR: " 126 << "invalid event format" << endl; 127 127 return kFALSE; 128 128 } … … 148 148 if(!rc) 149 149 { 150 cerr << "** ERROR: " << "invalid particle format" << endl; 150 cerr << "** ERROR: " 151 << "invalid particle format" << endl; 151 152 return kFALSE; 152 153 } … … 162 163 if(!pch) 163 164 { 164 cerr << "** ERROR: " << "invalid weight format" << endl; 165 cerr << "** ERROR: " 166 << "invalid weight format" << endl; 165 167 return kFALSE; 166 168 } … … 172 174 if(!pch) 173 175 { 174 cerr << "** ERROR: " << "invalid weight format" << endl; 176 cerr << "** ERROR: " 177 << "invalid weight format" << endl; 175 178 return kFALSE; 176 179 } … … 181 184 if(!rc) 182 185 { 183 cerr << "** ERROR: " << "invalid weight format" << endl; 186 cerr << "** ERROR: " 187 << "invalid weight format" << endl; 184 188 return kFALSE; 185 189 } … … 192 196 if(!pch) 193 197 { 194 cerr << "** ERROR: " << "invalid cross section format" << endl; 198 cerr << "** ERROR: " 199 << "invalid cross section format" << endl; 195 200 return kFALSE; 196 201 } … … 199 204 if(!pch) 200 205 { 201 cerr << "** ERROR: " << "invalid cross section format" << endl; 206 cerr << "** ERROR: " 207 << "invalid cross section format" << endl; 202 208 return kFALSE; 203 209 } … … 208 214 if(!rc) 209 215 { 210 cerr << "** ERROR: " << "invalid cross section format" << endl; 216 cerr << "** ERROR: " 217 << "invalid cross section format" << endl; 211 218 return kFALSE; 212 219 } … … 249 256 { 250 257 LHEFWeight *element; 251 vector< pair< int, double >>::const_iterator itWeightList;258 vector<pair<int, double>>::const_iterator itWeightList; 252 259 253 260 for(itWeightList = fWeightList.begin(); itWeightList != fWeightList.end(); ++itWeightList) … … 279 286 280 287 pdgParticle = fPDG->GetParticle(fPID); 281 candidate->Charge = pdgParticle ? int(pdgParticle->Charge() /3.0) : -999;288 candidate->Charge = pdgParticle ? int(pdgParticle->Charge() / 3.0) : -999; 282 289 candidate->Mass = fMass; 283 290 -
classes/DelphesLHEFReader.h
r45e58be r341014c 30 30 #include <stdio.h> 31 31 32 #include <utility> 32 33 #include <vector> 33 #include <utility>34 34 35 35 class TObjArray; … … 42 42 { 43 43 public: 44 45 44 DelphesLHEFReader(); 46 45 ~DelphesLHEFReader(); … … 62 61 63 62 private: 64 65 63 void AnalyzeParticle(DelphesFactory *factory, 66 64 TObjArray *allParticleOutputArray, … … 83 81 int fPID, fStatus, fM1, fM2, fC1, fC2; 84 82 double fPx, fPy, fPz, fE, fMass; 85 86 std::vector< std::pair< int, double >> fWeightList;83 84 std::vector<std::pair<int, double>> fWeightList; 87 85 }; 88 86 89 87 #endif // DelphesLHEFReader_h 90 91 -
classes/DelphesLongFormula.cc
r45e58be r341014c 16 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 17 */ 18 19 18 20 19 #include "classes/DelphesLongFormula.h" … … 54 53 for(it = expression; *it; ++it) 55 54 { 56 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' 55 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\') continue; 57 56 buffer.Append(*it); 58 57 } … … 66 65 buffer.ReplaceAll("ctgTheta", "[ctgTheta]"); 67 66 68 #if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)69 TFormula::SetMaxima(100000,1000,1000000);70 71 67 #if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0) 68 TFormula::SetMaxima(100000, 1000, 1000000); 69 #endif 70 72 71 if(TFormula::Compile(buffer) != 0) 73 72 { … … 80 79 //------------------------------------------------------------------------------ 81 80 82 Double_t DelphesLongFormula::Eval(Double_t pt, 83 Double_t eta, 84 Double_t phi, 85 Double_t energy, 86 Double_t d0, 87 Double_t dz, 88 Double_t ctgTheta 89 ) 81 Double_t DelphesLongFormula::Eval(Double_t pt, Double_t eta, Double_t phi, 82 Double_t energy, Double_t d0, Double_t dz, Double_t ctgTheta) 90 83 { 91 84 … … 93 86 TVarValMap fVarValMap; 94 87 95 fVarNameMap[this->GetParNumber("pt")] = "pt";96 fVarNameMap[this->GetParNumber("eta")] = "eta";97 fVarNameMap[this->GetParNumber("phi")] = "phi";98 fVarNameMap[this->GetParNumber("energy")] = "energy";99 fVarNameMap[this->GetParNumber("d0")] = "d0";100 fVarNameMap[this->GetParNumber("dz")] = "dz";101 fVarNameMap[this->GetParNumber("ctgTheta")] = "ctgTheta";88 fVarNameMap[this->GetParNumber("pt")] = "pt"; 89 fVarNameMap[this->GetParNumber("eta")] = "eta"; 90 fVarNameMap[this->GetParNumber("phi")] = "phi"; 91 fVarNameMap[this->GetParNumber("energy")] = "energy"; 92 fVarNameMap[this->GetParNumber("d0")] = "d0"; 93 fVarNameMap[this->GetParNumber("dz")] = "dz"; 94 fVarNameMap[this->GetParNumber("ctgTheta")] = "ctgTheta"; 102 95 103 fVarValMap["pt"] = pt;104 fVarValMap["eta"] = eta;105 fVarValMap["phi"] = phi;106 fVarValMap["energy"] = energy;107 fVarValMap["d0"] = d0;108 fVarValMap["dz"] = dz;109 fVarValMap["ctgTheta"] = ctgTheta;96 fVarValMap["pt"] = pt; 97 fVarValMap["eta"] = eta; 98 fVarValMap["phi"] = phi; 99 fVarValMap["energy"] = energy; 100 fVarValMap["d0"] = d0; 101 fVarValMap["dz"] = dz; 102 fVarValMap["ctgTheta"] = ctgTheta; 110 103 111 104 Double_t vals[7]; 112 105 113 106 Int_t j = 0; 114 for (Int_t i=0; i != 7; i++)107 for(Int_t i = 0; i != 7; i++) 115 108 { 116 if ( fVarNameMap.find(i) != fVarNameMap.end() )117 118 119 120 121 122 123 } 109 if(fVarNameMap.find(i) != fVarNameMap.end()) 110 { 111 TString var_name = fVarNameMap[i]; 112 vals[i] = fVarValMap[var_name]; 113 } 114 else 115 vals[i] = 0.; 116 } 124 117 return EvalPar(nullptr, vals); 125 118 } -
classes/DelphesLongFormula.h
r45e58be r341014c 26 26 { 27 27 public: 28 29 28 DelphesLongFormula(); 30 29 DelphesLongFormula(const char *name, const char *expression); … … 34 33 Int_t Compile(const char *expression); 35 34 36 Double_t Eval(Double_t pt, 37 Double_t eta = 0, 38 Double_t phi = 0, 39 Double_t energy = 0, 40 Double_t d0 = 0, 41 Double_t dz = 0, 42 Double_t ctgTheta = 0 43 ); 35 Double_t Eval(Double_t pt, Double_t eta = 0, Double_t phi = 0, 36 Double_t energy = 0, Double_t d0 = 0, Double_t dz = 0, Double_t ctgTheta = 0); 44 37 45 typedef std::map<Int_t, TString> TVarNameMap; //!38 typedef std::map<Int_t, TString> TVarNameMap; //! 46 39 typedef std::map<TString, Double_t> TVarValMap; //! 47 48 49 40 }; 50 41 -
classes/DelphesModule.cc
r45e58be r341014c 17 17 */ 18 18 19 20 19 /** \class DelphesModule 21 20 * … … 30 29 #include "classes/DelphesFactory.h" 31 30 31 #include "ExRootAnalysis/ExRootResult.h" 32 #include "ExRootAnalysis/ExRootTreeBranch.h" 32 33 #include "ExRootAnalysis/ExRootTreeReader.h" 33 #include "ExRootAnalysis/ExRootTreeBranch.h"34 34 #include "ExRootAnalysis/ExRootTreeWriter.h" 35 #include "ExRootAnalysis/ExRootResult.h"36 35 37 #include "TROOT.h"38 36 #include "TClass.h" 39 37 #include "TFolder.h" 40 38 #include "TObjArray.h" 39 #include "TROOT.h" 41 40 42 41 #include <iostream> 42 #include <sstream> 43 43 #include <stdexcept> 44 #include <sstream>45 44 46 45 using namespace std; … … 157 156 return fFactory; 158 157 } 159 160 -
classes/DelphesModule.h
r45e58be r341014c 41 41 class DelphesFactory; 42 42 43 class DelphesModule: public ExRootTask 43 class DelphesModule: public ExRootTask 44 44 { 45 45 public: 46 47 46 DelphesModule(); 48 47 ~DelphesModule(); … … 61 60 62 61 protected: 63 64 62 ExRootTreeWriter *fTreeWriter; 65 63 DelphesFactory *fFactory; 66 64 67 65 private: 68 69 66 ExRootResult *fPlots; 70 67 … … 75 72 76 73 #endif /* DelphesModule_h */ 77 -
classes/DelphesPileUpReader.cc
r45e58be r341014c 17 17 */ 18 18 19 20 19 /** \class DelphesPileUpReader 21 20 * … … 28 27 #include "classes/DelphesPileUpReader.h" 29 28 30 #include <stdexcept>31 29 #include <iostream> 32 30 #include <sstream> 31 #include <stdexcept> 33 32 33 #include <stdint.h> 34 34 #include <stdio.h> 35 #include <stdint.h>36 35 37 36 #include "classes/DelphesXDRReader.h" … … 52 51 stringstream message; 53 52 54 fIndex = new uint8_t[kIndexSize *8];55 fBuffer = new uint8_t[kBufferSize *kRecordSize*4];53 fIndex = new uint8_t[kIndexSize * 8]; 54 fBuffer = new uint8_t[kBufferSize * kRecordSize * 4]; 56 55 fInputReader = new DelphesXDRReader; 57 56 fIndexReader = new DelphesXDRReader; … … 82 81 83 82 // read index of events 84 fseeko(fPileUpFile, -8 - 8 *fEntries, SEEK_END);85 fInputReader->ReadRaw(fIndex, fEntries *8);83 fseeko(fPileUpFile, -8 - 8 * fEntries, SEEK_END); 84 fInputReader->ReadRaw(fIndex, fEntries * 8); 86 85 } 87 86 … … 130 129 131 130 // read event position 132 fIndexReader->SetOffset(8 *entry);131 fIndexReader->SetOffset(8 * entry); 133 132 fIndexReader->ReadValue(&offset, 8); 134 133 … … 142 141 } 143 142 144 fInputReader->ReadRaw(fBuffer, fEntrySize *kRecordSize*4);143 fInputReader->ReadRaw(fBuffer, fEntrySize * kRecordSize * 4); 145 144 fBufferReader->SetOffset(0); 146 145 fCounter = 0; -
classes/DelphesPileUpReader.h
r45e58be r341014c 28 28 */ 29 29 30 #include <stdint.h> 30 31 #include <stdio.h> 31 #include <stdint.h>32 32 33 33 class DelphesXDRReader; … … 36 36 { 37 37 public: 38 39 38 DelphesPileUpReader(const char *fileName); 40 39 … … 50 49 51 50 private: 52 53 51 int64_t fEntries; 54 52 -
classes/DelphesPileUpWriter.cc
r45e58be r341014c 17 17 */ 18 18 19 20 19 /** \class DelphesPileUpWriter 21 20 * … … 28 27 #include "classes/DelphesPileUpWriter.h" 29 28 30 #include <stdexcept>31 29 #include <iostream> 32 30 #include <sstream> 31 #include <stdexcept> 33 32 33 #include <stdint.h> 34 34 #include <stdio.h> 35 #include <stdint.h>36 35 37 36 #include "classes/DelphesXDRWriter.h" … … 52 51 stringstream message; 53 52 54 fIndex = new uint8_t[kIndexSize *8];55 fBuffer = new uint8_t[kBufferSize *kRecordSize*4];53 fIndex = new uint8_t[kIndexSize * 8]; 54 fBuffer = new uint8_t[kBufferSize * kRecordSize * 4]; 56 55 fOutputWriter = new DelphesXDRWriter; 57 56 fIndexWriter = new DelphesXDRWriter; … … 118 117 119 118 fOutputWriter->WriteValue(&fEntrySize, 4); 120 fOutputWriter->WriteRaw(fBuffer, fEntrySize *kRecordSize*4);119 fOutputWriter->WriteRaw(fBuffer, fEntrySize * kRecordSize * 4); 121 120 122 121 fIndexWriter->WriteValue(&fOffset, 8); 123 fOffset += fEntrySize *kRecordSize*4 + 4;122 fOffset += fEntrySize * kRecordSize * 4 + 4; 124 123 125 124 fBufferWriter->SetOffset(0); … … 133 132 void DelphesPileUpWriter::WriteIndex() 134 133 { 135 fOutputWriter->WriteRaw(fIndex, fEntries *8);134 fOutputWriter->WriteRaw(fIndex, fEntries * 8); 136 135 fOutputWriter->WriteValue(&fEntries, 8); 137 136 } -
classes/DelphesPileUpWriter.h
r45e58be r341014c 28 28 */ 29 29 30 #include <stdint.h> 30 31 #include <stdio.h> 31 #include <stdint.h>32 32 33 33 class DelphesXDRWriter; … … 36 36 { 37 37 public: 38 39 38 DelphesPileUpWriter(const char *fileName); 40 39 … … 50 49 51 50 private: 52 53 51 int64_t fEntries; 54 52 int32_t fEntrySize; -
classes/DelphesSTDHEPReader.cc
r45e58be r341014c 17 17 */ 18 18 19 20 19 /** \class DelphesSTDHEPReader 21 20 * … … 28 27 #include "classes/DelphesSTDHEPReader.h" 29 28 30 #include <stdexcept>31 29 #include <iostream> 32 30 #include <sstream> 33 34 #include <stdio.h> 31 #include <stdexcept> 32 35 33 #include <errno.h> 36 34 #include <stdint.h> 35 #include <stdio.h> 37 36 #include <string.h> 38 37 38 #include "TDatabasePDG.h" 39 #include "TLorentzVector.h" 39 40 #include "TObjArray.h" 41 #include "TParticlePDG.h" 40 42 #include "TStopwatch.h" 41 #include "TDatabasePDG.h"42 #include "TParticlePDG.h"43 #include "TLorentzVector.h"44 43 45 44 #include "classes/DelphesClasses.h" … … 51 50 using namespace std; 52 51 53 static const int kBufferSize 52 static const int kBufferSize = 1000000; 54 53 55 54 //--------------------------------------------------------------------------- … … 58 57 fInputFile(0), fBuffer(0), fPDG(0), fBlockType(-1) 59 58 { 60 fBuffer = new uint8_t[kBufferSize *96 + 24];59 fBuffer = new uint8_t[kBufferSize * 96 + 24]; 61 60 62 61 fPDG = TDatabasePDG::Instance(); … … 117 116 ReadEventHeader(); 118 117 } 119 else if(fBlockType == MCFIO_STDHEPBEG || 120 fBlockType == MCFIO_STDHEPEND) 118 else if(fBlockType == MCFIO_STDHEPBEG || fBlockType == MCFIO_STDHEPEND) 121 119 { 122 120 ReadSTDCM1(); … … 170 168 uint32_t size; 171 169 fReader[0].ReadValue(&size, 4); 172 SkipBytes(size *elsize);170 SkipBytes(size * elsize); 173 171 } 174 172 … … 178 176 { 179 177 uint32_t i; 180 enum STDHEPVersion {UNKNOWN, V1, V2, V21} version; 178 enum STDHEPVersion 179 { 180 UNKNOWN, 181 V1, 182 V2, 183 V21 184 } version; 181 185 182 186 // version 183 187 fReader[0].ReadString(fBuffer, 100); 184 if(fBuffer[0] == '\0' || fBuffer[1] == '\0') version = UNKNOWN; 185 else if(fBuffer[0] == '1') version = V1; 186 else if(strncmp((char *)fBuffer, "2.01", 4) == 0) version = V21; 187 else if(fBuffer[0] == '2') version = V2; 188 else version = UNKNOWN; 188 if(fBuffer[0] == '\0' || fBuffer[1] == '\0') 189 version = UNKNOWN; 190 else if(fBuffer[0] == '1') 191 version = V1; 192 else if(strncmp((char *)fBuffer, "2.01", 4) == 0) 193 version = V21; 194 else if(fBuffer[0] == '2') 195 version = V2; 196 else 197 version = UNKNOWN; 189 198 190 199 if(version == UNKNOWN) … … 363 372 // 4 + 4 + 4 + 4 + 4 + 4 = 96*n + 24 364 373 365 fReader[0].ReadRaw(fBuffer, 96 *fEventSize + 24);374 fReader[0].ReadRaw(fBuffer, 96 * fEventSize + 24); 366 375 367 376 fReader[1].SetBuffer(fBuffer); 368 fReader[2].SetBuffer(fBuffer + 4 *1 + 4*1*fEventSize);369 fReader[3].SetBuffer(fBuffer + 4 *2 + 4*2*fEventSize);370 fReader[4].SetBuffer(fBuffer + 4 *3 + 4*4*fEventSize);371 fReader[5].SetBuffer(fBuffer + 4 *4 + 4*6*fEventSize);372 fReader[6].SetBuffer(fBuffer + 4 *5 + 4*16*fEventSize);377 fReader[2].SetBuffer(fBuffer + 4 * 1 + 4 * 1 * fEventSize); 378 fReader[3].SetBuffer(fBuffer + 4 * 2 + 4 * 2 * fEventSize); 379 fReader[4].SetBuffer(fBuffer + 4 * 3 + 4 * 4 * fEventSize); 380 fReader[5].SetBuffer(fBuffer + 4 * 4 + 4 * 6 * fEventSize); 381 fReader[6].SetBuffer(fBuffer + 4 * 5 + 4 * 16 * fEventSize); 373 382 374 383 fReader[1].ReadValue(&idhepSize, 4); … … 391 400 fAlphaQCD = 0.0; 392 401 fScaleSize = 0; 393 memset(fScale, 0, 10 *sizeof(double));402 memset(fScale, 0, 10 * sizeof(double)); 394 403 } 395 404 … … 494 503 495 504 pdgParticle = fPDG->GetParticle(pid); 496 candidate->Charge = pdgParticle ? int(pdgParticle->Charge() /3.0) : -999;505 candidate->Charge = pdgParticle ? int(pdgParticle->Charge() / 3.0) : -999; 497 506 candidate->Mass = mass; 498 507 -
classes/DelphesSTDHEPReader.h
r45e58be r341014c 28 28 */ 29 29 30 #include <stdint.h> 30 31 #include <stdio.h> 31 #include <stdint.h>32 32 33 33 #include "classes/DelphesXDRReader.h" … … 72 72 73 73 private: 74 75 74 void AnalyzeParticles(DelphesFactory *factory, 76 75 TObjArray *allParticleOutputArray, -
classes/DelphesStream.cc
r45e58be r341014c 17 17 */ 18 18 19 20 19 /** \class DelphesStream 21 20 * … … 28 27 #include "classes/DelphesStream.h" 29 28 29 #include <errno.h> 30 #include <limits.h> 31 #include <math.h> 32 #include <stdio.h> 30 33 #include <stdlib.h> 31 #include <limits.h>32 34 #include <string.h> 33 #include <stdio.h>34 #include <errno.h>35 #include <math.h>36 35 37 36 #include <iostream> … … 65 64 if(fFirstHugePos && value == HUGE_VAL) 66 65 { 67 fFirstHugePos = false; 66 fFirstHugePos = false; 68 67 cout << "** WARNING: too large positive value, return " << value << endl; 69 68 } 70 69 else if(fFirstHugeNeg && value == -HUGE_VAL) 71 70 { 72 fFirstHugeNeg = false; 71 fFirstHugeNeg = false; 73 72 cout << "** WARNING: too large negative value, return " << value << endl; 74 73 } 75 74 else if(fFirstZero) 76 75 { 77 fFirstZero = false; 76 fFirstZero = false; 78 77 value = 0.0; 79 78 cout << "** WARNING: too small value, return " << value << endl; … … 94 93 if(fFirstLongMin && value == LONG_MIN) 95 94 { 96 fFirstLongMin = false; 95 fFirstLongMin = false; 97 96 cout << "** WARNING: too large positive value, return " << value << endl; 98 97 } 99 98 else if(fFirstLongMax && value == LONG_MAX) 100 99 { 101 fFirstLongMax = false; 100 fFirstLongMax = false; 102 101 cout << "** WARNING: too large negative value, return " << value << endl; 103 102 } -
classes/DelphesStream.h
r45e58be r341014c 31 31 { 32 32 public: 33 34 33 DelphesStream(char *buffer); 35 34 … … 38 37 39 38 private: 39 char *fBuffer; 40 40 41 char *fBuffer;42 43 41 static bool fFirstLongMin; 44 42 static bool fFirstLongMax; … … 49 47 50 48 #endif // DelphesStream_h 51 52 -
classes/DelphesTF2.cc
r45e58be r341014c 32 32 { 33 33 34 #if ROOT_VERSION_CODE >= ROOT_VERSION(6, 04,00)34 #if ROOT_VERSION_CODE >= ROOT_VERSION(6, 04, 00) 35 35 fFormula = new TFormula(); 36 36 #endif 37 38 39 37 } 40 38 … … 60 58 for(it = expression; *it; ++it) 61 59 { 62 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' 60 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\') continue; 63 61 buffer.Append(*it); 64 62 } 65 63 buffer.ReplaceAll("z", "x"); 66 64 buffer.ReplaceAll("t", "y"); 67 #if ROOT_VERSION_CODE < ROOT_VERSION(6, 04,00)65 #if ROOT_VERSION_CODE < ROOT_VERSION(6, 04, 00) 68 66 if(TF2::Compile(buffer) != 0) 69 67 #else -
classes/DelphesTF2.h
r45e58be r341014c 25 25 { 26 26 public: 27 28 27 DelphesTF2(); 29 28 -
classes/DelphesXDRReader.cc
r45e58be r341014c 17 17 */ 18 18 19 20 19 /** \class DelphesXDRReader 21 20 * … … 28 27 #include "classes/DelphesXDRReader.h" 29 28 29 #include <stdint.h> 30 30 #include <stdio.h> 31 #include <stdint.h>32 31 #include <string.h> 33 32 … … 109 108 110 109 if(size > maxSize) size = maxSize; 111 110 112 111 if(fBuffer) 113 112 { -
classes/DelphesXDRReader.h
r45e58be r341014c 28 28 */ 29 29 30 #include <stdint.h> 30 31 #include <stdio.h> 31 #include <stdint.h>32 32 33 33 class DelphesXDRReader 34 34 { 35 35 public: 36 37 36 DelphesXDRReader(); 38 37 … … 46 45 47 46 private: 48 49 47 FILE *fFile; 50 48 uint8_t *fBuffer; -
classes/DelphesXDRWriter.cc
r45e58be r341014c 17 17 */ 18 18 19 20 19 /** \class DelphesXDRWriter 21 20 * … … 28 27 #include "classes/DelphesXDRWriter.h" 29 28 29 #include <stdint.h> 30 30 #include <stdio.h> 31 #include <stdint.h>32 31 #include <string.h> 33 32 -
classes/DelphesXDRWriter.h
r45e58be r341014c 28 28 */ 29 29 30 #include <stdint.h> 30 31 #include <stdio.h> 31 #include <stdint.h>32 32 33 33 class DelphesXDRWriter 34 34 { 35 35 public: 36 37 36 DelphesXDRWriter(); 38 37 … … 45 44 46 45 private: 47 48 46 FILE *fFile; 49 47 uint8_t *fBuffer; -
classes/SortableObject.h
r45e58be r341014c 26 26 */ 27 27 28 #include "TObject.h" 28 29 #include "TRef.h" 29 #include "TObject.h"30 30 #include "TRefArray.h" 31 31 … … 37 37 { 38 38 public: 39 virtual ~CompBase() { 39 virtual ~CompBase() {} 40 40 virtual Bool_t IsSortable(const TObject *) const { return kTRUE; } 41 41 virtual Int_t Compare(const TObject *obj1, const TObject *obj2) const = 0; … … 47 47 { 48 48 public: 49 50 49 Bool_t IsSortable() const { return GetCompare() ? GetCompare()->IsSortable(this) : kFALSE; } 51 50 Int_t Compare(const TObject *obj) const { return GetCompare()->Compare(this, obj); } … … 64 63 { 65 64 CompE() {} 65 66 66 public: 67 67 static CompE *Instance() … … 73 73 Int_t Compare(const TObject *obj1, const TObject *obj2) const 74 74 { 75 const T *t1 = static_cast<const T *>(obj1);76 const T *t2 = static_cast<const T *>(obj2);75 const T *t1 = static_cast<const T *>(obj1); 76 const T *t2 = static_cast<const T *>(obj2); 77 77 if(t1->E > t2->E) 78 78 return -1; … … 90 90 { 91 91 CompPT() {} 92 92 93 public: 93 94 static CompPT *Instance() … … 99 100 Int_t Compare(const TObject *obj1, const TObject *obj2) const 100 101 { 101 const T *t1 = static_cast<const T *>(obj1);102 const T *t2 = static_cast<const T *>(obj2);102 const T *t1 = static_cast<const T *>(obj1); 103 const T *t2 = static_cast<const T *>(obj2); 103 104 if(t1->PT > t2->PT) 104 105 return -1; … … 116 117 { 117 118 CompMomentumPt() {} 119 118 120 public: 119 121 static CompMomentumPt *Instance() … … 125 127 Int_t Compare(const TObject *obj1, const TObject *obj2) const 126 128 { 127 const T *t1 = static_cast<const T *>(obj1);128 const T *t2 = static_cast<const T *>(obj2);129 const T *t1 = static_cast<const T *>(obj1); 130 const T *t2 = static_cast<const T *>(obj2); 129 131 if(t1->Momentum.Pt() > t2->Momentum.Pt()) 130 132 return -1; … … 142 144 { 143 145 CompET() {} 146 144 147 public: 145 148 static CompET *Instance() … … 151 154 Int_t Compare(const TObject *obj1, const TObject *obj2) const 152 155 { 153 const T *t1 = static_cast<const T *>(obj1);154 const T *t2 = static_cast<const T *>(obj2);156 const T *t1 = static_cast<const T *>(obj1); 157 const T *t2 = static_cast<const T *>(obj2); 155 158 if(t1->ET > t2->ET) 156 159 return -1; … … 168 171 { 169 172 CompSumPT2() {} 173 170 174 public: 171 175 static CompSumPT2 *Instance() … … 177 181 Int_t Compare(const TObject *obj1, const TObject *obj2) const 178 182 { 179 const T *t1 = static_cast<const T *>(obj1);180 const T *t2 = static_cast<const T *>(obj2);183 const T *t1 = static_cast<const T *>(obj1); 184 const T *t2 = static_cast<const T *>(obj2); 181 185 if(t1->SumPT2 > t2->SumPT2) 182 186 return -1; … … 193 197 class CompDeltaR: public CompBase 194 198 { 195 CompDeltaR(const T2 *obj = 0) : fObj(obj) {} 199 CompDeltaR(const T2 *obj = 0) : 200 fObj(obj) {} 196 201 197 202 Double_t DeltaPhi(Double_t phi1, Double_t phi2) 198 203 { 199 204 Double_t phi = TMath::Abs(phi1 - phi2); 200 return (phi <= TMath::Pi()) ? phi : (2.0 *TMath::Pi()) - phi;201 } 202 203 Double_t Sqr(Double_t x) { return x *x; }205 return (phi <= TMath::Pi()) ? phi : (2.0 * TMath::Pi()) - phi; 206 } 207 208 Double_t Sqr(Double_t x) { return x * x; } 204 209 205 210 Double_t SumSqr(Double_t a, Double_t b) … … 207 212 Double_t aAbs = TMath::Abs(a); 208 213 Double_t bAbs = TMath::Abs(b); 209 if(aAbs > bAbs) return aAbs * TMath::Sqrt(1.0 + Sqr(bAbs / aAbs)); 210 else return (bAbs == 0) ? 0.0 : bAbs * TMath::Sqrt(1.0 + Sqr(aAbs / bAbs)); 214 if(aAbs > bAbs) 215 return aAbs * TMath::Sqrt(1.0 + Sqr(bAbs / aAbs)); 216 else 217 return (bAbs == 0) ? 0.0 : bAbs * TMath::Sqrt(1.0 + Sqr(aAbs / bAbs)); 211 218 }; 212 219 … … 214 221 215 222 public: 216 217 { 218 219 223 static CompDeltaR *Instance(const T2 *obj = 0) 224 { 225 static CompDeltaR single(obj); 226 return &single; 220 227 } 221 228 … … 225 232 { 226 233 Double_t eta[3], phi[3], deltaR[2]; 227 const T1 *t1 = static_cast<const T1 *>(obj1);228 const T1 *t2 = static_cast<const T1 *>(obj2);234 const T1 *t1 = static_cast<const T1 *>(obj1); 235 const T1 *t2 = static_cast<const T1 *>(obj2); 229 236 230 237 eta[0] = fObj->Eta; … … 250 257 251 258 #endif // SortableObject_h 252 253
Note:
See TracChangeset
for help on using the changeset viewer.