Changes in / [9ad08ca:c008923] in git
- Files:
-
- 11 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r9ad08ca rc008923 319 319 modules/EnergySmearing.h \ 320 320 modules/MomentumSmearing.h \ 321 modules/TrackSmearing.h \322 321 modules/ImpactParameterSmearing.h \ 323 322 modules/TimeSmearing.h \ … … 342 341 modules/StatusPidFilter.h \ 343 342 modules/PdgCodeFilter.h \ 344 modules/BeamSpotFilter.h \345 343 modules/Cloner.h \ 346 344 modules/Weighter.h \ … … 348 346 modules/JetFlavorAssociation.h \ 349 347 modules/JetFakeParticle.h \ 350 modules/VertexSorter.h \351 modules/VertexFinder.h \352 348 modules/ExampleModule.h 353 349 tmp/modules/ModulesDict$(PcmSuf): \ … … 556 552 classes/DelphesFactory.h \ 557 553 classes/DelphesFormula.h 558 tmp/modules/BeamSpotFilter.$(ObjSuf): \559 modules/BeamSpotFilter.$(SrcSuf) \560 modules/BeamSpotFilter.h \561 classes/DelphesClasses.h \562 classes/DelphesFactory.h \563 classes/DelphesFormula.h \564 external/ExRootAnalysis/ExRootResult.h \565 external/ExRootAnalysis/ExRootFilter.h \566 external/ExRootAnalysis/ExRootClassifier.h567 554 tmp/modules/Calorimeter.$(ObjSuf): \ 568 555 modules/Calorimeter.$(SrcSuf) \ … … 855 842 external/ExRootAnalysis/ExRootFilter.h \ 856 843 external/ExRootAnalysis/ExRootClassifier.h 857 tmp/modules/TrackSmearing.$(ObjSuf): \858 modules/TrackSmearing.$(SrcSuf) \859 modules/TrackSmearing.h \860 classes/DelphesClasses.h \861 classes/DelphesFactory.h \862 classes/DelphesFormula.h \863 external/ExRootAnalysis/ExRootResult.h \864 external/ExRootAnalysis/ExRootFilter.h \865 external/ExRootAnalysis/ExRootClassifier.h866 844 tmp/modules/TreeWriter.$(ObjSuf): \ 867 845 modules/TreeWriter.$(SrcSuf) \ … … 880 858 classes/DelphesFactory.h \ 881 859 classes/DelphesFormula.h \ 882 external/ExRootAnalysis/ExRootResult.h \883 external/ExRootAnalysis/ExRootFilter.h \884 external/ExRootAnalysis/ExRootClassifier.h885 tmp/modules/VertexFinder.$(ObjSuf): \886 modules/VertexFinder.$(SrcSuf) \887 modules/VertexFinder.h \888 classes/DelphesClasses.h \889 classes/DelphesFactory.h \890 classes/DelphesFormula.h \891 classes/DelphesPileUpReader.h \892 external/ExRootAnalysis/ExRootResult.h \893 external/ExRootAnalysis/ExRootFilter.h \894 external/ExRootAnalysis/ExRootClassifier.h895 tmp/modules/VertexSorter.$(ObjSuf): \896 modules/VertexSorter.$(SrcSuf) \897 modules/VertexSorter.h \898 classes/DelphesClasses.h \899 classes/DelphesFactory.h \900 classes/DelphesFormula.h \901 classes/DelphesPileUpReader.h \902 860 external/ExRootAnalysis/ExRootResult.h \ 903 861 external/ExRootAnalysis/ExRootFilter.h \ … … 963 921 tmp/modules/AngularSmearing.$(ObjSuf) \ 964 922 tmp/modules/BTagging.$(ObjSuf) \ 965 tmp/modules/BeamSpotFilter.$(ObjSuf) \966 923 tmp/modules/Calorimeter.$(ObjSuf) \ 967 924 tmp/modules/Cloner.$(ObjSuf) \ … … 995 952 tmp/modules/TrackCountingTauTagging.$(ObjSuf) \ 996 953 tmp/modules/TrackPileUpSubtractor.$(ObjSuf) \ 997 tmp/modules/TrackSmearing.$(ObjSuf) \998 954 tmp/modules/TreeWriter.$(ObjSuf) \ 999 955 tmp/modules/UniqueObjectFinder.$(ObjSuf) \ 1000 tmp/modules/VertexFinder.$(ObjSuf) \1001 tmp/modules/VertexSorter.$(ObjSuf) \1002 956 tmp/modules/Weighter.$(ObjSuf) 1003 957 … … 1604 1558 tmp/external/tcl/tclVar.$(ObjSuf) 1605 1559 1606 modules/TrackSmearing.h: \1607 classes/DelphesModule.h1608 @touch $@1609 1610 1560 external/fastjet/ClusterSequence.hh: \ 1611 1561 external/fastjet/PseudoJet.hh \ … … 1865 1815 @touch $@ 1866 1816 1867 modules/VertexSorter.h: \1868 classes/DelphesModule.h \1869 classes/DelphesClasses.h1870 @touch $@1871 1872 1817 modules/Delphes.h: \ 1873 1818 classes/DelphesModule.h 1874 @touch $@1875 1876 modules/VertexFinder.h: \1877 classes/DelphesModule.h \1878 classes/DelphesClasses.h1879 1819 @touch $@ 1880 1820 … … 2043 1983 2044 1984 modules/FastJetFinder.h: \ 2045 classes/DelphesModule.h2046 @touch $@2047 2048 modules/BeamSpotFilter.h: \2049 1985 classes/DelphesModule.h 2050 1986 @touch $@ -
classes/DelphesClasses.cc
r9ad08ca rc008923 41 41 CompBase *Tower::fgCompare = CompE<Tower>::Instance(); 42 42 CompBase *HectorHit::fgCompare = CompE<HectorHit>::Instance(); 43 CompBase *Vertex::fgCompare = CompSumPT2<Vertex>::Instance();44 43 CompBase *Candidate::fgCompare = CompMomentumPt<Candidate>::Instance(); 45 44 … … 122 121 Charge(0), Mass(0.0), 123 122 IsPU(0), IsRecoPU(0), IsConstituent(0), IsFromConversion(0), 124 ClusterIndex(-1), ClusterNDF(0), ClusterSigma(0), SumPT2(0), BTVSumPT2(0), GenDeltaZ(0), GenSumPT2(0),125 123 Flavor(0), FlavorAlgo(0), FlavorPhys(0), 126 124 BTag(0), BTagAlgo(0), BTagPhys(0), … … 129 127 Momentum(0.0, 0.0, 0.0, 0.0), 130 128 Position(0.0, 0.0, 0.0, 0.0), 131 PositionError(0.0, 0.0, 0.0, 0.0),132 InitialPosition(0.0, 0.0, 0.0, 0.0),133 129 Area(0.0, 0.0, 0.0, 0.0), 134 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), 130 Dxy(0), SDxy(0), Xd(0), Yd(0), Zd(0), 142 131 TrackResolution(0), 143 132 NCharged(0), … … 256 245 object.IsConstituent = IsConstituent; 257 246 object.IsFromConversion = IsFromConversion; 258 object.ClusterIndex = ClusterIndex;259 object.ClusterNDF = ClusterNDF;260 object.ClusterSigma = ClusterSigma;261 object.SumPT2 = SumPT2;262 object.BTVSumPT2 = BTVSumPT2;263 object.GenDeltaZ = GenDeltaZ;264 object.GenSumPT2 = GenSumPT2;265 247 object.Flavor = Flavor; 266 248 object.FlavorAlgo = FlavorAlgo; … … 280 262 object.Momentum = Momentum; 281 263 object.Position = Position; 282 object.InitialPosition = InitialPosition;283 object.PositionError = PositionError;284 264 object.Area = Area; 285 object.L = L; 286 object.ErrorT = ErrorT; 287 object.D0 = D0; 288 object.ErrorD0 = ErrorD0; 289 object.DZ = DZ; 290 object.ErrorDZ = ErrorDZ; 291 object.P = P; 292 object.ErrorP = ErrorP; 293 object.PT = PT; 294 object.ErrorPT = ErrorPT; 295 object.CtgTheta = CtgTheta ; 296 object.ErrorCtgTheta = ErrorCtgTheta; 297 object.Phi = Phi; 298 object.ErrorPhi = ErrorPhi; 265 object.Dxy = Dxy; 266 object.SDxy = SDxy; 299 267 object.Xd = Xd; 300 268 object.Yd = Yd; … … 314 282 object.SumPtChargedPU = SumPtChargedPU; 315 283 object.SumPt = SumPt; 316 object.ClusterIndex = ClusterIndex; 317 object.ClusterNDF = ClusterNDF; 318 object.ClusterSigma = ClusterSigma; 319 object.SumPT2 = SumPT2; 320 284 321 285 object.FracPt[0] = FracPt[0]; 322 286 object.FracPt[1] = FracPt[1]; … … 399 363 Momentum.SetXYZT(0.0, 0.0, 0.0, 0.0); 400 364 Position.SetXYZT(0.0, 0.0, 0.0, 0.0); 401 InitialPosition.SetXYZT(0.0, 0.0, 0.0, 0.0);402 365 Area.SetXYZT(0.0, 0.0, 0.0, 0.0); 403 L = 0.0; 404 ErrorT = 0.0; 405 D0 = 0.0; 406 ErrorD0 = 0.0; 407 DZ = 0.0; 408 ErrorDZ = 0.0; 409 P =0.0; 410 ErrorP =0.0; 411 PT = 0.0; 412 ErrorPT = 0.0; 413 CtgTheta = 0.0; 414 ErrorCtgTheta = 0.0; 415 Phi = 0.0; 416 ErrorPhi = 0.0; 366 Dxy = 0.0; 367 SDxy = 0.0; 417 368 Xd = 0.0; 418 369 Yd = 0.0; … … 436 387 SumPt = -999; 437 388 438 ClusterIndex = -1;439 ClusterNDF = -99;440 ClusterSigma = 0.0;441 SumPT2 = 0.0;442 BTVSumPT2 = 0.0;443 GenDeltaZ = 0.0;444 GenSumPT2 = 0.0;445 446 389 FracPt[0] = 0.0; 447 390 FracPt[1] = 0.0; -
classes/DelphesClasses.h
r9ad08ca rc008923 147 147 Float_t Pz; // particle momentum vector (z component) | hepevt.phep[number][2] 148 148 149 Float_t D0; 150 Float_t DZ; 151 Float_t P; 152 Float_t PT; 153 Float_t CtgTheta; 154 Float_t Phi; 149 Float_t PT; // particle transverse momentum 155 150 Float_t Eta; // particle pseudorapidity 151 Float_t Phi; // particle azimuthal angle 152 156 153 Float_t Rapidity; // particle rapidity 157 154 … … 171 168 //--------------------------------------------------------------------------- 172 169 173 class Vertex: public SortableObject170 class Vertex: public TObject 174 171 { 175 172 public: … … 179 176 Float_t Z; // vertex position (z component) 180 177 181 Double_t ErrorX; 182 Double_t ErrorY; 183 Double_t ErrorZ; 184 Double_t ErrorT; 185 186 Int_t Index; 187 Int_t NDF; 188 Double_t Sigma; 189 Double_t SumPT2; 190 Double_t BTVSumPT2; 191 Double_t GenDeltaZ; 192 Double_t GenSumPT2; 193 194 TRefArray Constituents; // references to constituents 195 196 static CompBase *fgCompare; //! 197 const CompBase *GetCompare() const { return fgCompare; } 198 199 ClassDef(Vertex, 3) 178 ClassDef(Vertex, 1) 200 179 }; 201 180 … … 418 397 Int_t Charge; // track charge 419 398 399 Float_t PT; // track transverse momentum 400 420 401 Float_t Eta; // track pseudorapidity 402 Float_t Phi; // track azimuthal angle 421 403 422 404 Float_t EtaOuter; // track pseudorapidity at the tracker edge … … 433 415 Float_t TOuter; // track position (z component) at the tracker edge 434 416 435 Float_t L; // track path length 436 Float_t ErrorT; // error on the time measurement 437 438 Float_t D0; // track signed transverse impact parameter 439 Float_t ErrorD0; // signed error on the track signed transverse impact parameter 440 441 Float_t DZ; // track transverse momentum 442 Float_t ErrorDZ; // track transverse momentum error 443 444 Float_t P; // track transverse momentum 445 Float_t ErrorP; // track transverse momentum error 446 447 Float_t PT; // track transverse momentum 448 Float_t ErrorPT; // track transverse momentum error 449 450 Float_t CtgTheta; // track transverse momentum 451 Float_t ErrorCtgTheta; // track transverse momentum error 452 453 Float_t Phi; // track azimuthal angle 454 Float_t ErrorPhi; // track azimuthal angle 455 417 Float_t Dxy; // track signed transverse impact parameter 418 Float_t SDxy; // signed error on the track signed transverse impact parameter 456 419 Float_t Xd; // X coordinate of point of closest approach to vertex 457 420 Float_t Yd; // Y coordinate of point of closest approach to vertex … … 460 423 TRef Particle; // reference to generated particle 461 424 462 Int_t VertexIndex; // reference to vertex463 464 425 static CompBase *fgCompare; //! 465 426 const CompBase *GetCompare() const { return fgCompare; } … … 565 526 Float_t DeltaPhi; 566 527 567 TLorentzVector Momentum, Position, InitialPosition, PositionError, Area; 568 569 Float_t L; // path length 570 Float_t ErrorT; // path length 571 Float_t D0; 572 Float_t ErrorD0; 573 Float_t DZ; 574 Float_t ErrorDZ; 575 Float_t P; 576 Float_t ErrorP; 577 Float_t PT; 578 Float_t ErrorPT; 579 Float_t CtgTheta; 580 Float_t ErrorCtgTheta; 581 Float_t Phi; 582 Float_t ErrorPhi; 583 528 TLorentzVector Momentum, Position, Area; 529 530 Float_t Dxy; 531 Float_t SDxy; 584 532 Float_t Xd; 585 533 Float_t Yd; … … 587 535 588 536 // tracking resolution 589 537 590 538 Float_t TrackResolution; 591 539 … … 614 562 Float_t SumPt; 615 563 616 // vertex variables617 618 Int_t ClusterIndex;619 Int_t ClusterNDF;620 Double_t ClusterSigma;621 Double_t SumPT2;622 Double_t BTVSumPT2;623 Double_t GenDeltaZ;624 Double_t GenSumPT2;625 626 564 // N-subjettiness variables 627 565 … … 657 595 void SetFactory(DelphesFactory *factory) { fFactory = factory; } 658 596 659 ClassDef(Candidate, 5)597 ClassDef(Candidate, 4) 660 598 }; 661 599 -
classes/SortableObject.h
r9ad08ca rc008923 156 156 return -1; 157 157 else if(t1->ET < t2->ET) 158 return 1;159 else160 return 0;161 }162 };163 164 //---------------------------------------------------------------------------165 166 template <typename T>167 class CompSumPT2: public CompBase168 {169 CompSumPT2() {}170 public:171 static CompSumPT2 *Instance()172 {173 static CompSumPT2 single;174 return &single;175 }176 177 Int_t Compare(const TObject *obj1, const TObject *obj2) const178 {179 const T *t1 = static_cast<const T*>(obj1);180 const T *t2 = static_cast<const T*>(obj2);181 if(t1->SumPT2 > t2->SumPT2)182 return -1;183 else if(t1->SumPT2 < t2->SumPT2)184 158 return 1; 185 159 else -
doc/genMakefile.tcl
r9ad08ca rc008923 263 263 executableDeps {converters/*.cpp} {examples/*.cpp} 264 264 265 executableDeps {readers/DelphesHepMC.cpp} {readers/DelphesLHEF.cpp} {readers/DelphesSTDHEP.cpp} {readers/DelphesROOT.cpp}265 executableDeps {readers/DelphesHepMC.cpp} {readers/DelphesLHEF.cpp} {readers/DelphesSTDHEP.cpp} 266 266 267 267 puts {ifeq ($(HAS_CMSSW),true)} -
modules/ImpactParameterSmearing.cc
r9ad08ca rc008923 96 96 { 97 97 Candidate *candidate, *particle, *mother; 98 Double_t xd, yd, zd, d 0, sx, sy, sz, dd0;98 Double_t xd, yd, zd, dxy, sx, sy, sz, ddxy; 99 99 Double_t pt, eta, px, py, phi, e; 100 100 … … 103 103 { 104 104 105 // take momentum before smearing (otherwise apply double smearing on d 0)105 // take momentum before smearing (otherwise apply double smearing on dxy) 106 106 particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0)); 107 107 … … 131 131 132 132 // calculate impact parameter (after-smearing) 133 d 0= (xd*py - yd*px)/pt;133 dxy = (xd*py - yd*px)/pt; 134 134 135 dd 0= gRandom->Gaus(0.0, fFormula->Eval(pt, eta, phi, e));135 ddxy = gRandom->Gaus(0.0, fFormula->Eval(pt, eta, phi, e)); 136 136 137 137 // fill smeared values in candidate … … 143 143 candidate->Zd = zd; 144 144 145 candidate->D 0 = d0;146 candidate-> ErrorD0 = dd0;145 candidate->Dxy = dxy; 146 candidate->SDxy = ddxy; 147 147 148 148 candidate->AddCandidate(mother); -
modules/ModulesLinkDef.h
r9ad08ca rc008923 35 35 #include "modules/EnergySmearing.h" 36 36 #include "modules/MomentumSmearing.h" 37 #include "modules/TrackSmearing.h"38 37 #include "modules/ImpactParameterSmearing.h" 39 38 #include "modules/TimeSmearing.h" … … 58 57 #include "modules/StatusPidFilter.h" 59 58 #include "modules/PdgCodeFilter.h" 60 #include "modules/BeamSpotFilter.h"61 59 #include "modules/Cloner.h" 62 60 #include "modules/Weighter.h" … … 64 62 #include "modules/JetFlavorAssociation.h" 65 63 #include "modules/JetFakeParticle.h" 66 #include "modules/VertexSorter.h"67 #include "modules/VertexFinder.h"68 #include "modules/VertexFinderDA4D.h"69 64 #include "modules/ExampleModule.h" 70 65 … … 84 79 #pragma link C++ class EnergySmearing+; 85 80 #pragma link C++ class MomentumSmearing+; 86 #pragma link C++ class TrackSmearing+;87 81 #pragma link C++ class ImpactParameterSmearing+; 88 82 #pragma link C++ class TimeSmearing+; … … 107 101 #pragma link C++ class StatusPidFilter+; 108 102 #pragma link C++ class PdgCodeFilter+; 109 #pragma link C++ class BeamSpotFilter+;110 103 #pragma link C++ class Cloner+; 111 104 #pragma link C++ class Weighter+; … … 113 106 #pragma link C++ class JetFlavorAssociation+; 114 107 #pragma link C++ class JetFakeParticle+; 115 #pragma link C++ class VertexSorter+;116 #pragma link C++ class VertexFinder+;117 #pragma link C++ class VertexFinderDA4D+;118 108 #pragma link C++ class ExampleModule+; 119 109 -
modules/ParticlePropagator.cc
r9ad08ca rc008923 66 66 { 67 67 } 68 69 68 70 69 //------------------------------------------------------------------------------ … … 92 91 fItInputArray = fInputArray->MakeIterator(); 93 92 94 // import beamspot95 try96 {97 fBeamSpotInputArray = ImportArray(GetString("BeamSpotInputArray", "BeamSpotFilter/beamSpotParticle"));98 }99 catch(runtime_error &e)100 {101 fBeamSpotInputArray = 0;102 }103 93 // create output arrays 104 94 … … 121 111 { 122 112 Candidate *candidate, *mother; 123 TLorentzVector candidatePosition, candidateMomentum , beamSpotPosition;113 TLorentzVector candidatePosition, candidateMomentum; 124 114 Double_t px, py, pz, pt, pt2, e, q; 125 115 Double_t x, y, z, t, r, phi; … … 130 120 Double_t tmp, discr, discr2; 131 121 Double_t delta, gammam, omega, asinrho; 132 Double_t rcu, rc2, xd, yd, zd; 133 Double_t l, d0, dz, p, ctgTheta, phip, etap, alpha; 134 Double_t bsx, bsy, bsz; 135 122 Double_t rcu, rc2, dxy, xd, yd, zd; 123 136 124 const Double_t c_light = 2.99792458E8; 137 138 if (!fBeamSpotInputArray || fBeamSpotInputArray->GetSize () == 0) 139 beamSpotPosition.SetXYZT(0.0, 0.0, 0.0, 0.0); 140 else 141 { 142 Candidate &beamSpotCandidate = *((Candidate *) fBeamSpotInputArray->At(0)); 143 beamSpotPosition = beamSpotCandidate.Position; 144 } 145 125 146 126 fItInputArray->Reset(); 147 127 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) … … 152 132 y = candidatePosition.Y()*1.0E-3; 153 133 z = candidatePosition.Z()*1.0E-3; 154 155 bsx = beamSpotPosition.X()*1.0E-3;156 bsy = beamSpotPosition.Y()*1.0E-3;157 bsz = beamSpotPosition.Z()*1.0E-3;158 159 134 q = candidate->Charge; 160 135 … … 206 181 y_t = y + py*t; 207 182 z_t = z + pz*t; 208 209 l = TMath::Sqrt( (x_t - x)*(x_t - x) + (y_t - y)*(y_t - y) + (z_t - z)*(z_t - z));210 183 211 184 mother = candidate; 212 185 candidate = static_cast<Candidate*>(candidate->Clone()); 213 186 214 candidate->InitialPosition = candidatePosition;215 187 candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t*e*1.0E3); 216 candidate->L = l*1.0E3; 217 188 218 189 candidate->Momentum = candidateMomentum; 219 190 candidate->AddCandidate(mother); … … 267 238 yd = (rc2 > 0.0) ? yd / rc2 : -999; 268 239 zd = z + (TMath::Sqrt(xd*xd + yd*yd) - TMath::Sqrt(x*x + y*y))*pz/pt; 269 270 // use perigee momentum rather than original particle 271 // momentum, since the orignal particle momentum isn't known 272 273 px = TMath::Sign(1.0,r) * pt * (-y_c / r_c); 274 py = TMath::Sign(1.0,r) * pt * (x_c / r_c); 275 etap = candidateMomentum.Eta(); 276 phip = TMath::ATan2(py, px); 277 278 candidateMomentum.SetPtEtaPhiE(pt, etap, phip, candidateMomentum.E()); 279 280 // calculate additional track parameters (correct for beamspot position) 281 282 d0 = ( (x - bsx) * py - (y - bsy) * px) / pt; 283 dz = z - ((x - bsx) * px + (y - bsy) * py) / pt * (pz / pt); 284 p = candidateMomentum.P(); 285 ctgTheta = 1.0 / TMath::Tan (candidateMomentum.Theta ()); 286 240 241 // calculate impact paramater 242 dxy = (xd*py - yd*px)/pt; 243 287 244 // 3. time evaluation t = TMath::Min(t_r, t_z) 288 245 // t_r : time to exit from the sides … … 330 287 r_t = TMath::Hypot(x_t, y_t); 331 288 332 333 // compute path length for an helix334 335 alpha = pz*1.0E9 / c_light / gammam;336 l = t * TMath::Sqrt(alpha*alpha + r*r*omega*omega);337 338 289 if(r_t > 0.0) 339 290 { 340 341 // store these variables before cloning342 343 candidate->D0 = d0*1.0E3;344 candidate->DZ = dz*1.0E3;345 candidate->P = p;346 candidate->PT = pt;347 candidate->CtgTheta = ctgTheta;348 candidate->Phi = phip;349 350 291 mother = candidate; 351 292 candidate = static_cast<Candidate*>(candidate->Clone()); 352 293 353 candidate->InitialPosition = candidatePosition;354 294 candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t*c_light*1.0E3); 355 295 356 296 candidate->Momentum = candidateMomentum; 357 358 candidate->L = l*1.0E3; 359 360 candidate->Xd = xd*1.0E3; 297 candidate->Dxy = dxy*1.0E3; 298 candidate->Xd = xd*1.0E3; 361 299 candidate->Yd = yd*1.0E3; 362 300 candidate->Zd = zd*1.0E3; -
modules/ParticlePropagator.h
r9ad08ca rc008923 35 35 class TClonesArray; 36 36 class TIterator; 37 class TLorentzVector;38 37 39 38 class ParticlePropagator: public DelphesModule … … 56 55 57 56 const TObjArray *fInputArray; //! 58 const TObjArray *fBeamSpotInputArray; //!59 57 60 58 TObjArray *fOutputArray; //! -
modules/PileUpMerger.cc
r9ad08ca rc008923 115 115 TDatabasePDG *pdg = TDatabasePDG::Instance(); 116 116 TParticlePDG *pdgParticle; 117 Int_t pid , nch, nvtx = -1;117 Int_t pid; 118 118 Float_t x, y, z, t, vx, vy; 119 Float_t px, py, pz, e , pt;120 Double_t dz, dphi, dt , sumpt2, dz0, dt0;119 Float_t px, py, pz, e; 120 Double_t dz, dphi, dt; 121 121 Int_t numberOfEvents, event, numberOfParticles; 122 122 Long64_t allEntries, entry; … … 132 132 fFunction->GetRandom2(dz, dt); 133 133 134 dz0 = -1.0e6;135 dt0 = -1.0e6;136 137 134 dt *= c_light*1.0E3; // necessary in order to make t in mm/c 138 135 dz *= 1.0E3; // necessary in order to make z in mm 139 140 //cout<<dz<<","<<dt<<endl;141 142 136 vx = 0.0; 143 137 vy = 0.0; 144 145 138 numberOfParticles = fInputArray->GetEntriesFast(); 146 nch = 0;147 sumpt2 = 0.0;148 149 factory = GetFactory();150 vertex = factory->NewCandidate();151 152 139 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) 153 140 { … … 156 143 z = candidate->Position.Z(); 157 144 t = candidate->Position.T(); 158 pt = candidate->Momentum.Pt(); 159 160 // take postion and time from first stable particle 161 if (dz0 < -999999.0) 162 dz0 = z; 163 if (dt0 < -999999.0) 164 dt0 = t; 165 166 // cancel any possible offset in position and time the input file 167 candidate->Position.SetZ(z - dz0 + dz); 168 candidate->Position.SetT(t - dt0 + dt); 169 170 candidate->IsPU = 0; 171 145 candidate->Position.SetZ(z + dz); 146 candidate->Position.SetT(t + dt); 172 147 fParticleOutputArray->Add(candidate); 173 174 if(TMath::Abs(candidate->Charge) > 1.0E-9)175 {176 nch++;177 sumpt2 += pt*pt;178 vertex->AddCandidate(candidate);179 }180 148 } 181 149 182 150 if(numberOfParticles > 0) 183 151 { 184 vx /= sumpt2; 185 vy /= sumpt2; 186 } 187 188 nvtx++; 152 vx /= numberOfParticles; 153 vy /= numberOfParticles; 154 } 155 156 factory = GetFactory(); 157 158 vertex = factory->NewCandidate(); 189 159 vertex->Position.SetXYZT(vx, vy, dz, dt); 190 vertex->ClusterIndex = nvtx;191 vertex->ClusterNDF = nch;192 vertex->SumPT2 = sumpt2;193 vertex->GenSumPT2 = sumpt2;194 160 fVertexOutputArray->Add(vertex); 195 161 … … 204 170 numberOfEvents = gRandom->Integer(2*fMeanPileUp + 1); 205 171 break; 206 case 2:207 numberOfEvents = fMeanPileUp;208 break;209 172 default: 210 173 numberOfEvents = gRandom->Poisson(fMeanPileUp); … … 213 176 214 177 allEntries = fReader->GetEntries(); 215 216 178 217 179 for(event = 0; event < numberOfEvents; ++event) … … 236 198 vx = 0.0; 237 199 vy = 0.0; 238 239 200 numberOfParticles = 0; 240 sumpt2 = 0.0;241 242 //factory = GetFactory();243 vertex = factory->NewCandidate();244 245 201 while(fReader->ReadParticle(pid, x, y, z, t, px, py, pz, e)) 246 202 { … … 259 215 candidate->Momentum.SetPxPyPzE(px, py, pz, e); 260 216 candidate->Momentum.RotateZ(dphi); 261 pt = candidate->Momentum.Pt();262 217 263 218 x -= fInputBeamSpotX; … … 269 224 vx += candidate->Position.X(); 270 225 vy += candidate->Position.Y(); 271 272 226 ++numberOfParticles; 273 if(TMath::Abs(candidate->Charge) > 1.0E-9)274 {275 nch++;276 sumpt2 += pt*pt;277 vertex->AddCandidate(candidate);278 }279 227 280 228 fParticleOutputArray->Add(candidate); … … 287 235 } 288 236 289 nvtx++; 290 237 vertex = factory->NewCandidate(); 291 238 vertex->Position.SetXYZT(vx, vy, dz, dt); 292 293 vertex->ClusterIndex = nvtx;294 vertex->ClusterNDF = nch;295 vertex->SumPT2 = sumpt2;296 vertex->GenSumPT2 = sumpt2;297 298 239 vertex->IsPU = 1; 299 240 300 241 fVertexOutputArray->Add(vertex); 301 302 } 303 } 304 305 //------------------------------------------------------------------------------ 242 } 243 } 244 245 //------------------------------------------------------------------------------ -
modules/SimpleCalorimeter.cc
r9ad08ca rc008923 366 366 energy = momentum.E() * fTrackFractions[number]; 367 367 368 fTrackTime += energy*position.T();369 fTrackTimeWeight += energy;368 fTrackTime += TMath::Sqrt(energy)*position.T(); 369 fTrackTimeWeight += TMath::Sqrt(energy); 370 370 371 371 if(fTrackFractions[number] > 1.0E-9) … … 403 403 fTowerEnergy += energy; 404 404 405 fTowerTime += energy*position.T();406 fTowerTimeWeight += energy;405 fTowerTime += TMath::Sqrt(energy)*position.T(); 406 fTowerTimeWeight += TMath::Sqrt(energy); 407 407 408 408 fTower->AddCandidate(particle); -
modules/TimeSmearing.cc
r9ad08ca rc008923 93 93 { 94 94 Candidate *candidate, *mother; 95 Double_t t i, tf_smeared, tf;95 Double_t t; 96 96 const Double_t c_light = 2.99792458E8; 97 97 … … 99 99 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) 100 100 { 101 const TLorentzVector &candidateInitialPosition = candidate->InitialPosition; 102 const TLorentzVector &candidateFinalPosition = candidate->Position; 103 104 ti = candidateInitialPosition.T()*1.0E-3/c_light; 105 tf = candidateFinalPosition.T()*1.0E-3/c_light; 101 const TLorentzVector &candidatePosition = candidate->Position; 102 t = candidatePosition.T()*1.0E-3/c_light; 106 103 107 104 // apply smearing formula 108 tf_smeared = gRandom->Gaus(tf, fTimeResolution); 109 ti = ti + tf_smeared - tf; 105 t = gRandom->Gaus(t, fTimeResolution); 110 106 111 107 mother = candidate; 112 108 candidate = static_cast<Candidate*>(candidate->Clone()); 113 candidate->InitialPosition.SetT(ti*1.0E3*c_light); 114 candidate->Position.SetT(tf*1.0E3*c_light); 115 116 candidate->ErrorT = fTimeResolution*1.0E3*c_light; 109 candidate->Position.SetT(t*1.0E3*c_light); 117 110 118 111 candidate->AddCandidate(mother); -
modules/TrackCountingBTagging.cc
r9ad08ca rc008923 96 96 97 97 Double_t jpx, jpy; 98 Double_t dr, tp t;99 Double_t xd, yd, d 0, dd0, ip, sip;98 Double_t dr, tpx, tpy, tpt; 99 Double_t xd, yd, dxy, ddxy, ip, sip; 100 100 101 101 Int_t sign; … … 117 117 { 118 118 const TLorentzVector &trkMomentum = track->Momentum; 119 119 120 120 dr = jetMomentum.DeltaR(trkMomentum); 121 121 122 tpt = trkMomentum.Pt(); 123 tpx = trkMomentum.Px(); 124 tpy = trkMomentum.Py(); 125 122 126 xd = track->Xd; 123 127 yd = track->Yd; 124 d 0= TMath::Hypot(xd, yd);125 dd 0 = track->ErrorD0;128 dxy = TMath::Hypot(xd, yd); 129 ddxy = track->SDxy; 126 130 127 131 if(tpt < fPtMin) continue; 128 132 if(dr > fDeltaR) continue; 129 if(d 0> fIPmax) continue;133 if(dxy > fIPmax) continue; 130 134 131 135 sign = (jpx*xd + jpy*yd > 0.0) ? 1 : -1; 132 136 133 ip = sign*d 0;134 sip = ip / TMath::Abs(dd 0);137 ip = sign*dxy; 138 sip = ip / TMath::Abs(ddxy); 135 139 136 140 if(sip > fSigMin) count++; -
modules/TreeWriter.cc
r9ad08ca rc008923 215 215 entry->Pz = momentum.Pz(); 216 216 217 entry->D0 = candidate->D0;218 entry->DZ = candidate->DZ;219 entry->P = candidate->P;220 entry->PT = candidate->PT;221 entry->CtgTheta = candidate->CtgTheta;222 entry->Phi = candidate->Phi;223 224 217 entry->Eta = eta; 225 218 entry->Phi = momentum.Phi(); … … 240 233 { 241 234 TIter iterator(array); 242 Candidate *candidate = 0 , *constituent = 0;235 Candidate *candidate = 0; 243 236 Vertex *entry = 0; 244 237 245 238 const Double_t c_light = 2.99792458E8; 246 239 247 Double_t x, y, z, t, xError, yError, zError, tError, sigma, sumPT2, btvSumPT2, genDeltaZ, genSumPT2;248 UInt_t index, ndf;249 250 CompBase *compare = Candidate::fgCompare;251 Candidate::fgCompare = CompSumPT2<Candidate>::Instance();252 array->Sort();253 Candidate::fgCompare = compare;254 255 240 // loop over all vertices 256 241 iterator.Reset(); 257 242 while((candidate = static_cast<Candidate*>(iterator.Next()))) 258 243 { 259 260 index = candidate->ClusterIndex; 261 ndf = candidate->ClusterNDF; 262 sigma = candidate->ClusterSigma; 263 sumPT2 = candidate->SumPT2; 264 btvSumPT2 = candidate->BTVSumPT2; 265 genDeltaZ = candidate->GenDeltaZ; 266 genSumPT2 = candidate->GenSumPT2; 267 268 x = candidate->Position.X(); 269 y = candidate->Position.Y(); 270 z = candidate->Position.Z(); 271 t = candidate->Position.T()*1.0E-3/c_light; 272 273 xError = candidate->PositionError.X (); 274 yError = candidate->PositionError.Y (); 275 zError = candidate->PositionError.Z (); 276 tError = candidate->PositionError.T ()*1.0E-3/c_light; 244 const TLorentzVector &position = candidate->Position; 277 245 278 246 entry = static_cast<Vertex*>(branch->NewEntry()); 279 247 280 entry->Index = index; 281 entry->NDF = ndf; 282 entry->Sigma = sigma; 283 entry->SumPT2 = sumPT2; 284 entry->BTVSumPT2 = btvSumPT2; 285 entry->GenDeltaZ = genDeltaZ; 286 entry->GenSumPT2 = genSumPT2; 287 288 entry->X = x; 289 entry->Y = y; 290 entry->Z = z; 291 entry->T = t; 292 293 entry->ErrorX = xError; 294 entry->ErrorY = yError; 295 entry->ErrorZ = zError; 296 entry->ErrorT = tError; 297 298 299 TIter itConstituents(candidate->GetCandidates()); 300 itConstituents.Reset(); 301 entry->Constituents.Clear(); 302 while((constituent = static_cast<Candidate*>(itConstituents.Next()))) 303 { 304 entry->Constituents.Add(constituent); 305 } 306 307 } 308 } 309 248 entry->X = position.X(); 249 entry->Y = position.Y(); 250 entry->Z = position.Z(); 251 entry->T = position.T()*1.0E-3/c_light; 252 } 253 } 310 254 311 255 //------------------------------------------------------------------------------ … … 348 292 entry->TOuter = position.T()*1.0E-3/c_light; 349 293 350 entry->L = candidate->L; 351 352 entry->D0 = candidate->D0; 353 entry->ErrorD0 = candidate->ErrorD0; 354 entry->DZ = candidate->DZ; 355 entry->ErrorDZ = candidate->ErrorDZ; 356 entry->P = candidate->P; 357 entry->ErrorP = candidate->ErrorP; 358 entry->PT = candidate->PT; 359 entry->ErrorPT = candidate->ErrorPT; 360 entry->CtgTheta = candidate->CtgTheta; 361 entry->ErrorCtgTheta = candidate->ErrorCtgTheta; 362 entry->Phi = candidate->Phi; 363 entry->ErrorPhi = candidate->ErrorPhi; 364 294 entry->Dxy = candidate->Dxy; 295 entry->SDxy = candidate->SDxy ; 365 296 entry->Xd = candidate->Xd; 366 297 entry->Yd = candidate->Yd; … … 376 307 377 308 entry->Eta = eta; 309 entry->Phi = momentum.Phi(); 310 entry->PT = pt; 378 311 379 312 particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0)); … … 386 319 387 320 entry->Particle = particle; 388 389 entry->VertexIndex = candidate->ClusterIndex;390 391 321 } 392 322 } -
readers/DelphesCMSFWLite.cpp
r9ad08ca rc008923 240 240 241 241 branchEvent = treeWriter->NewBranch("Event", HepMCEvent::Class()); 242 branchRwgt = treeWriter->NewBranch(" Weight", Weight::Class());242 branchRwgt = treeWriter->NewBranch("Rwgt", Weight::Class()); 243 243 244 244 confReader = new ExRootConfReader;
Note:
See TracChangeset
for help on using the changeset viewer.