Changes in / [54ec182:4564cba] in git
- Files:
-
- 11 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r54ec182 r4564cba 464 464 modules/ParticleDensity.h \ 465 465 modules/TruthVertexFinder.h \ 466 modules/ExampleModule.h 466 modules/ExampleModule.h \ 467 modules/LLPFilter.h \ 468 modules/CscClusterEfficiency.h \ 469 modules/CscClusterId.h 467 470 tmp/modules/ModulesDict$(PcmSuf): \ 468 471 tmp/modules/ModulesDict.$(SrcSuf) … … 518 521 classes/DelphesFactory.h \ 519 522 classes/SortableObject.h 523 tmp/classes/DelphesCscClusterFormula.$(ObjSuf): \ 524 classes/DelphesCscClusterFormula.$(SrcSuf) \ 525 classes/DelphesCscClusterFormula.h \ 526 classes/DelphesClasses.h 520 527 tmp/classes/DelphesCylindricalFormula.$(ObjSuf): \ 521 528 classes/DelphesCylindricalFormula.$(SrcSuf) \ … … 742 749 external/ExRootAnalysis/ExRootFilter.h \ 743 750 external/ExRootAnalysis/ExRootResult.h 751 tmp/modules/CscClusterEfficiency.$(ObjSuf): \ 752 modules/CscClusterEfficiency.$(SrcSuf) \ 753 modules/CscClusterEfficiency.h \ 754 classes/DelphesClasses.h \ 755 classes/DelphesFactory.h \ 756 classes/DelphesCscClusterFormula.h \ 757 external/ExRootAnalysis/ExRootClassifier.h \ 758 external/ExRootAnalysis/ExRootFilter.h \ 759 external/ExRootAnalysis/ExRootResult.h 760 tmp/modules/CscClusterId.$(ObjSuf): \ 761 modules/CscClusterId.$(SrcSuf) \ 762 modules/CscClusterId.h \ 763 classes/DelphesClasses.h \ 764 classes/DelphesFactory.h \ 765 classes/DelphesCscClusterFormula.h \ 766 external/ExRootAnalysis/ExRootClassifier.h \ 767 external/ExRootAnalysis/ExRootFilter.h \ 768 external/ExRootAnalysis/ExRootResult.h 744 769 tmp/modules/DecayFilter.$(ObjSuf): \ 745 770 modules/DecayFilter.$(SrcSuf) \ … … 882 907 external/ExRootAnalysis/ExRootFilter.h \ 883 908 external/ExRootAnalysis/ExRootResult.h 909 tmp/modules/LLPFilter.$(ObjSuf): \ 910 modules/LLPFilter.$(SrcSuf) \ 911 modules/LLPFilter.h \ 912 classes/DelphesClasses.h \ 913 classes/DelphesFactory.h \ 914 classes/DelphesFormula.h \ 915 external/ExRootAnalysis/ExRootClassifier.h \ 916 external/ExRootAnalysis/ExRootFilter.h \ 917 external/ExRootAnalysis/ExRootResult.h 884 918 tmp/modules/LeptonDressing.$(ObjSuf): \ 885 919 modules/LeptonDressing.$(SrcSuf) \ … … 1163 1197 DELPHES_OBJ += \ 1164 1198 tmp/classes/DelphesClasses.$(ObjSuf) \ 1199 tmp/classes/DelphesCscClusterFormula.$(ObjSuf) \ 1165 1200 tmp/classes/DelphesCylindricalFormula.$(ObjSuf) \ 1166 1201 tmp/classes/DelphesFactory.$(ObjSuf) \ … … 1227 1262 tmp/modules/ClusterCounting.$(ObjSuf) \ 1228 1263 tmp/modules/ConstituentFilter.$(ObjSuf) \ 1264 tmp/modules/CscClusterEfficiency.$(ObjSuf) \ 1265 tmp/modules/CscClusterId.$(ObjSuf) \ 1229 1266 tmp/modules/DecayFilter.$(ObjSuf) \ 1230 1267 tmp/modules/Delphes.$(ObjSuf) \ … … 1242 1279 tmp/modules/JetFlavorAssociation.$(ObjSuf) \ 1243 1280 tmp/modules/JetPileUpSubtractor.$(ObjSuf) \ 1281 tmp/modules/LLPFilter.$(ObjSuf) \ 1244 1282 tmp/modules/LeptonDressing.$(ObjSuf) \ 1245 1283 tmp/modules/Merger.$(ObjSuf) \ … … 1928 1966 @touch $@ 1929 1967 1968 modules/LLPFilter.h: \ 1969 classes/DelphesModule.h 1970 @touch $@ 1971 1930 1972 external/fastjet/internal/MinHeap.hh: \ 1931 1973 external/fastjet/internal/base.hh … … 2257 2299 @touch $@ 2258 2300 2301 modules/CscClusterEfficiency.h: \ 2302 classes/DelphesModule.h 2303 @touch $@ 2304 2259 2305 external/fastjet/PseudoJetStructureBase.hh: \ 2260 2306 external/fastjet/internal/base.hh … … 2381 2427 external/fastjet/config.h: \ 2382 2428 external/fastjet/config_win.h 2429 @touch $@ 2430 2431 modules/CscClusterId.h: \ 2432 classes/DelphesModule.h 2383 2433 @touch $@ 2384 2434 -
classes/ClassesLinkDef.h
r54ec182 r4564cba 57 57 #pragma link C++ class Electron+; 58 58 #pragma link C++ class Muon+; 59 #pragma link C++ class CscCluster+; 60 59 61 #pragma link C++ class Jet+; 60 62 #pragma link C++ class Track+; … … 66 68 67 69 #endif 68 -
classes/DelphesClasses.cc
r54ec182 r4564cba 35 35 CompBase *Electron::fgCompare = CompPT<Electron>::Instance(); 36 36 CompBase *Muon::fgCompare = CompPT<Muon>::Instance(); 37 37 38 CompBase *Jet::fgCompare = CompPT<Jet>::Instance(); 38 39 CompBase *Track::fgCompare = CompPT<Track>::Instance(); … … 42 43 CompBase *Vertex::fgCompare = CompSumPT2<Vertex>::Instance(); 43 44 CompBase *Candidate::fgCompare = CompMomentumPt<Candidate>::Instance(); 45 CompBase *CscCluster::fgCompare = CompE<CscCluster>::Instance(); 44 46 45 47 //------------------------------------------------------------------------------ … … 218 220 Position(0.0, 0.0, 0.0, 0.0), 219 221 InitialPosition(0.0, 0.0, 0.0, 0.0), 222 DecayPosition(0.0, 0.0, 0.0, 0.0), 220 223 PositionError(0.0, 0.0, 0.0, 0.0), 221 224 Area(0.0, 0.0, 0.0, 0.0), … … 230 233 Phi(0), ErrorPhi(0), 231 234 Xd(0), Yd(0), Zd(0), 235 XFirstHit(0), YFirstHit(0), ZFirstHit(0), 232 236 Nclusters(0.0), 233 237 dNdx(0.0), … … 388 392 object.Position = Position; 389 393 object.InitialPosition = InitialPosition; 394 object.DecayPosition = DecayPosition; 390 395 object.PositionError = PositionError; 391 396 object.Area = Area; … … 409 414 object.Yd = Yd; 410 415 object.Zd = Zd; 416 object.XFirstHit = XFirstHit; 417 object.YFirstHit = YFirstHit; 418 object.ZFirstHit = ZFirstHit; 411 419 object.Nclusters = Nclusters; 412 420 object.dNdx = dNdx; … … 523 531 Position.SetXYZT(0.0, 0.0, 0.0, 0.0); 524 532 InitialPosition.SetXYZT(0.0, 0.0, 0.0, 0.0); 533 DecayPosition.SetXYZT(0.0, 0.0, 0.0, 0.0); 525 534 Area.SetXYZT(0.0, 0.0, 0.0, 0.0); 526 535 TrackCovariance.Zero(); … … 544 553 Yd = 0.0; 545 554 Zd = 0.0; 555 XFirstHit = 0.0; 556 YFirstHit = 0.0; 557 ZFirstHit = 0.0; 546 558 Nclusters = 0.0; 547 559 dNdx = 0.0; -
classes/DelphesClasses.h
r54ec182 r4564cba 158 158 Float_t Z; // particle vertex position (z component) | hepevt.vhep[number][2] 159 159 160 Float_t decayX; 161 Float_t decayY; 162 Float_t decayZ; 163 Float_t decayT; 164 160 165 static CompBase *fgCompare; //! 161 166 const CompBase *GetCompare() const { return fgCompare; } … … 457 462 Float_t Yd; // Y coordinate of point of closest approach to vertex 458 463 Float_t Zd; // Z coordinate of point of closest approach to vertex 464 465 Float_t XFirstHit; // X coordinate of point of closest approach to vertex 466 Float_t YFirstHit; // Y coordinate of point of closest approach to vertex 467 Float_t ZFirstHit; // Z coordinate of point of closest approach to vertex 459 468 460 469 Float_t L; // track path length … … 565 574 Float_t Zd; // Z coordinate of point of closest approach to vertex 566 575 576 Float_t XFirstHit; // X coordinate of point of closest approach to vertex 577 Float_t YFirstHit; // Y coordinate of point of closest approach to vertex 578 Float_t ZFirstHit; // Z coordinate of point of closest approach to vertex 579 567 580 Float_t L; // track path length 568 581 Float_t D0; // track transverse impact parameter … … 638 651 ClassDef(HectorHit, 1) 639 652 }; 653 //--------------------------------------------------------------------------- 654 655 class CscCluster: public SortableObject 656 { 657 public: 658 Float_t Eta; // eta of LLP 659 Float_t Phi; // phi of LLP 660 Float_t PT; // pt of LLP 661 Float_t Px;// px of LLP 662 Float_t Py;// py of LLP 663 Float_t Pz;// pz of LLP 664 Float_t E; // E of LLP 665 Float_t Ehad; // had energy of LLP 666 Float_t Eem; // em energy of LLP 667 Float_t pid; // LLP pid 668 Float_t T; // LLP decay time-photon travel time 669 Float_t X; // LLP decay x 670 Float_t Y; // LLP decay y 671 Float_t Z; // LLP decay z 672 Float_t R; // LLP decay z 673 Float_t beta; // LLP beta 674 Float_t ctau; //LLP ctau 675 676 677 static CompBase *fgCompare; //! 678 const CompBase *GetCompare() const { return fgCompare; } 679 680 ClassDef(CscCluster, 5) 681 }; 640 682 641 683 //--------------------------------------------------------------------------- … … 682 724 Float_t DeltaPhi; 683 725 684 TLorentzVector Momentum, Position, InitialPosition, PositionError, Area;726 TLorentzVector Momentum, Position, InitialPosition, PositionError, DecayPosition, Area; 685 727 686 728 Float_t L; // path length … … 708 750 Float_t Zd; 709 751 752 Float_t XFirstHit; 753 Float_t YFirstHit; 754 Float_t ZFirstHit; 755 710 756 // tracking resolution 711 757 -
classes/DelphesHepMC2Reader.cc
r54ec182 r4564cba 438 438 { 439 439 Candidate *candidate; 440 Candidate *candidateDaughter; 440 441 map<int, pair<int, int> >::iterator itMotherMap; 441 442 map<int, pair<int, int> >::iterator itDaughterMap; … … 446 447 candidate = static_cast<Candidate *>(allParticleOutputArray->At(i)); 447 448 449 448 450 if(candidate->M1 > 0) 449 451 { … … 477 479 candidate->D1 = -1; 478 480 candidate->D2 = -1; 479 } 481 const TLorentzVector &decayPosition = candidate->Position; 482 candidate->DecayPosition.SetXYZT(decayPosition.X(), decayPosition.Y(), decayPosition.Z(), decayPosition.T());// decay position 483 } 480 484 else 481 485 { 482 486 candidate->D1 = itDaughterMap->second.first; 483 487 candidate->D2 = itDaughterMap->second.second; 484 } 485 } 486 } 487 } 488 489 //--------------------------------------------------------------------------- 488 candidateDaughter = static_cast<Candidate *>(allParticleOutputArray->At(candidate->D1)); 489 const TLorentzVector &decayPosition = candidateDaughter->Position; 490 candidate->DecayPosition.SetXYZT(decayPosition.X(), decayPosition.Y(), decayPosition.Z(), decayPosition.T());// decay position 491 492 493 } 494 } 495 } 496 } 497 498 //--------------------------------------------------------------------------- -
classes/DelphesHepMC3Reader.cc
r54ec182 r4564cba 458 458 TObjArray *array; 459 459 Candidate *candidate; 460 Candidate *candidateDaughter; 460 461 TParticlePDG *pdgParticle; 461 462 int pdgCode; … … 573 574 candidate->D1 = -1; 574 575 candidate->D2 = -1; 576 const TLorentzVector &decayPosition = candidate->Position; 577 candidate->DecayPosition.SetXYZT(decayPosition.X(), decayPosition.Y(), decayPosition.Z(), decayPosition.T());// decay position 575 578 } 576 579 else … … 578 581 candidate->D1 = itDaughterMap->second.first; 579 582 candidate->D2 = itDaughterMap->second.second; 580 } 581 } 582 } 583 } 584 585 //--------------------------------------------------------------------------- 583 candidateDaughter = static_cast<Candidate *>(allParticleOutputArray->At(candidate->D1)); 584 const TLorentzVector &decayPosition = candidateDaughter->Position; 585 candidate->DecayPosition.SetXYZT(decayPosition.X(), decayPosition.Y(), decayPosition.Z(), decayPosition.T());// decay position 586 } 587 } 588 } 589 } 590 591 //--------------------------------------------------------------------------- -
examples/ExamplePVtxFind.C
r54ec182 r4564cba 45 45 TH1D* hTrFoundB = new TH1D("hTrFoundB", "Found BAD primary tracks", 41, -0.5, 40.5); 46 46 TH1D* hTrDiff = new TH1D("hTrDiff", "Found - available tracks", 21, -10.5, 10.5); 47 // Chi2 for cuts 48 TH1D* hChi2SngP = new TH1D("hChi2SngP", "#chi^2 for single tracks", 200, 0., 50.); 49 TH1D* hChi2MaxP = new TH1D("hChi2MaxP", "#chi^2 max contribution", 200, 0., 50.); 50 TH1D* hChi2SngN = new TH1D("hChi2SngN", "#chi^2 for single tracks", 200, 0., 50.); 51 TH1D* hChi2MaxN = new TH1D("hChi2MaxN", "#chi^2 max contribution", 200, 0., 50.); 52 53 47 54 // 48 55 // Loop over all events … … 53 60 treeReader->ReadEntry(entry); 54 61 Int_t NtrG = branchTrack->GetEntries(); 55 if(entry%500 ==0)std::cout << "Event "<<entry<<" opened containing " << NtrG << " tracks" << std::endl;56 T VectorD** pr = new TVectorD * [NtrG];57 TMatrixDSym** cv = new TMatrixDSym * [NtrG];62 TVectorD** pr = new TVectorD * [NtrG]; // Track Parameters 63 TMatrixDSym** cv = new TMatrixDSym * [NtrG]; // Track covariances 64 Bool_t *fprvx = new Bool_t[NtrG]; // Primary vertex flag 58 65 // 59 66 // test Particle branch … … 88 95 pr[it] = new TVectorD(obsPar); 89 96 cv[it] = new TMatrixDSym(trk->CovarianceMatrix()); 90 // Check covariance91 /*92 TMatrixDSymEigen Eign(*cv[it]);93 TVectorD lambda = Eign.GetEigenValues();94 Bool_t good = kTRUE;95 for(Int_t i=0; i<5; i++) if(lambda(i)<0.0) good = kFALSE;96 if(!good){97 std::cout<<"Cov["<<it<<"]"<<" eigenvalues: "98 <<lambda(0)<<", "<<lambda(1)<<", "<<lambda(2)<<", "99 <<lambda(3)<<", "<<lambda(4)<<std::endl;100 TMatrixDSym Ctmp = *cv[it];101 std::cout<<"Error D (dir - cov) "<<trk->ErrorD0102 <<" - "<<TMath::Sqrt(Ctmp(0,0))<<std::endl;103 }104 */105 //std::cout << "Track loaded it= " << it << std::endl;106 97 // 107 98 // Find true primary vertex … … 114 105 Double_t z = gp->Z; 115 106 Bool_t prim = kTRUE; // Is primary? 107 fprvx[it] = kFALSE; 116 108 Int_t mp = gp->M1; // Mother 117 109 while (mp > 0) { … … 129 121 if (prim) { // It's a primary track 130 122 Nprim++; 123 fprvx[it] = kTRUE; 131 124 xpv = x; // Store true primary 132 125 ypv = y; … … 136 129 } // End loop on tracks 137 130 } 138 std::cout<<"PVtxFind true vertex: Nprim= "<<Nprim<<", x,y,z= "<<xpv<<", "<<ypv<<", "<<zpv<<std::endl; 131 if(entry%500 ==0){ 132 std::cout << "Event "<<entry<<" opened containing " << NtrG << " / "<< Nprim 133 << " Total / primary tracks"<< std::endl; 134 } 135 //std::cout<<"PVtxFind true vertex: Nprim= "<<Nprim<<", x,y,z= "<<xpv<<", "<<ypv<<", "<<zpv<<std::endl; 139 136 // 140 137 // Find primary vertex … … 161 158 TVectorD** PrSk = new TVectorD * [1]; 162 159 TMatrixDSym** CvSk = new TMatrixDSym * [1]; 163 Double_t MaxChi2 = 2.0+3*2.;160 Double_t MaxChi2 = 9.; 164 161 for (Int_t n = 0; n < NtrG; n++) { 165 162 PrSk[0] = new TVectorD(*pr[n]); … … 169 166 Double_t Chi2One = Vskim->GetVtxChi2(); 170 167 //std::cout<<"Track "<<n<<", Chi2 = "<<Chi2One<<std::endl; 168 if(fprvx[n])hChi2SngP->Fill(Chi2One); 169 else hChi2SngN->Fill(Chi2One); 170 // 171 171 if (Chi2One < MaxChi2) { 172 172 nSkimmed[nSkim] = n; … … 184 184 // Load tracks for primary fit 185 185 Int_t MinTrk = 1; // Minumum # tracks for vertex fit 186 std::vector<Int_t> trnum; 186 187 if (nSkim >= MinTrk) { 187 188 TVectorD** PrFit = new TVectorD * [nSkim]; … … 190 191 PrFit[n] = new TVectorD(*pr[nSkimmed[n]]); 191 192 CvFit[n] = new TMatrixDSym(*cv[nSkimmed[n]]); 193 trnum.push_back(nSkimmed[n]); 192 194 } 193 195 delete[] nSkimmed; … … 200 202 // 201 203 // Remove tracks with large chi2 202 Double_t MaxChi2Fit = 4.5;204 Double_t MaxChi2Fit = 8.0; 203 205 Bool_t Done = kFALSE; 204 206 while (!Done) { … … 213 215 Double_t Chi2Mx = Chi2L[iMax]; 214 216 //std::cout << "Chi2Mx "<<Chi2Mx << std::endl; 217 if(fprvx[trnum[iMax]])hChi2MaxP->Fill(Chi2Mx); 218 else hChi2MaxN->Fill(Chi2Mx); 215 219 if (Chi2Mx > MaxChi2Fit && Nfound > 1) { 216 220 //std::cout << "Before remove. Nfound = "<<Nfound << std::endl; 217 221 Vtx->RemoveTrk(iMax); 222 trnum.erase(trnum.begin() + iMax); 218 223 //std::cout << "After remove." << std::endl; 219 224 Nfound--; … … 230 235 if (Nfound >= Nmin) { 231 236 TVectorD xvtx = Vtx->GetVtx(); 232 std::cout << "Found vertex " << xvtx(0)<<", "<<xvtx(1)<<", "<<xvtx(2) << std::endl;237 //std::cout << "Found vertex " << xvtx(0)<<", "<<xvtx(1)<<", "<<xvtx(2) << std::endl; 233 238 TMatrixDSym covX = Vtx->GetVtxCov(); 234 239 Double_t Chi2 = Vtx->GetVtxChi2(); … … 256 261 delete[] PrFit; 257 262 delete[] CvFit; 263 delete[] fprvx; 264 trnum.clear(); 258 265 } 259 266 … … 271 278 TCanvas* Cnv = new TCanvas("Cnv", "Delphes primary vertex pulls", 50, 50, 900, 500); 272 279 Cnv->Divide(2, 2); 273 Cnv->cd(1); gPad->SetLogy(1); gStyle->SetOptFit(1111); 280 Cnv->cd(1); gPad->SetLogy(1); gStyle->SetOptFit(1111); gStyle->SetOptStat(111111); 274 281 hXpull->Fit("gaus"); hXpull->Draw(); 275 Cnv->cd(2); gPad->SetLogy(1); gStyle->SetOptFit(1111); 282 Cnv->cd(2); gPad->SetLogy(1); gStyle->SetOptFit(1111); gStyle->SetOptStat(111111); 276 283 hYpull->Fit("gaus"); hYpull->Draw(); 277 Cnv->cd(3); gPad->SetLogy(1); gStyle->SetOptFit(1111); 284 Cnv->cd(3); gPad->SetLogy(1); gStyle->SetOptFit(1111); gStyle->SetOptStat(111111); 278 285 hZpull->Fit("gaus"); hZpull->Draw(); 279 286 Cnv->cd(4); hChi2->Draw(); … … 288 295 CnvN->cd(3); 289 296 hTrDiff->Draw(); 297 // 298 TCanvas* CnvCh = new TCanvas("CnvCh", "#chi^2", 200, 200, 900, 500); 299 CnvCh->Divide(2,1); 300 CnvCh->cd(1); 301 hChi2SngP->Draw(); 302 hChi2SngN->SetLineColor(kRed); 303 hChi2SngN->Draw("SAME"); 304 CnvCh->cd(2); 305 hChi2MaxP->Draw(); 306 hChi2MaxN->SetLineColor(kRed); 307 hChi2MaxN->Draw("SAME"); 290 308 } -
external/TrackCovariance/ObsTrk.cc
r54ec182 r4564cba 74 74 fCovILC.ResizeTo(5, 5); 75 75 fGenPar = XPtoPar(fGenX, fGenP, Q); 76 fGenParMm = ParToMm(fGenPar); 76 77 fGenParACTS = ParToACTS(fGenPar); 77 78 fGenParILC = ParToILC(fGenPar); 78 79 // 79 80 fObsPar = GenToObsPar(fGenPar); 81 fObsParMm = ParToMm(fObsPar); 80 82 fObsParACTS = ParToACTS(fObsPar); 81 83 fObsParILC = ParToILC(fObsPar); … … 83 85 fObsP = ParToP(fObsPar); 84 86 fObsQ = ParToQ(fObsPar); 87 fCovMm = CovToMm(fCov); 85 88 fCovACTS = CovToACTS(fObsPar, fCov); 86 89 fCovILC = CovToILC(fCov); … … 117 120 //if (pt > maxPt) std::cout << "Warning ObsTrk::GenToObsPar: pt " << pt << " is above grid range of " << maxPt << std::endl; 118 121 Double_t minAn = fGC->GetMinAng(); 119 //if (angd < minAn) std::cout << "Warning ObsTrk::GenToObsPar: angle " << angd 122 //if (angd < minAn) std::cout << "Warning ObsTrk::GenToObsPar: angle " << angd 120 123 // << " is below grid range of " << minAn << std::endl; 121 124 Double_t maxAn = fGC->GetMaxAng(); … … 131 134 Double_t ZinNeg = fG->GetZminNeg(); 132 135 Bool_t inside = TrkUtil::IsInside(fGenX, Rin, ZinNeg, ZinPos); // Check if in inner box 136 SolTrack* trk = new SolTrack(fGenX, fGenP, fG); 137 Double_t Xfirst, Yfirst, Zfirst; 138 Int_t iLay = trk->FirstHit(Xfirst, Yfirst, Zfirst); 139 fXfirst = TVector3(Xfirst, Yfirst, Zfirst); 140 //std::cout<<"obs trk: "<<Xfirst<<","<<Yfirst<<","<<Zfirst<<std::endl; 141 133 142 if (inside) 134 143 { … … 144 153 //std::cout<<"ObsTrk:: outside: x= "<<fGenX(0)<<", y= "<<fGenX(1) 145 154 // <<", z= "<<fGenX(2)<<std::endl; 146 SolTrack* trk = new SolTrack(fGenX, fGenP, fG);147 155 Bool_t Res = kTRUE; Bool_t MS = kTRUE; 148 156 trk->CovCalc(Res, MS); // Calculate covariance matrix 149 Cov = trk->Cov(); // Track covariance150 delete trk;151 }157 Cov = trk->Cov(); 158 } // Track covariance 159 delete trk; 152 160 // 153 161 fCov = Cov; -
external/TrackCovariance/ObsTrk.h
r54ec182 r4564cba 46 46 TMatrixDSym fCovILC; // Covariance of track parameters in ILC format 47 47 // (d0, phi0, w, z0, tan(lambda)) 48 TVector3 fXfirst; // x,y,z of first track hit 48 49 // 49 50 // Service routines … … 89 90 TMatrixDSym GetCovMm() { return fCov; } // in mm 90 91 TMatrixDSym GetCovACTS(){ return fCovACTS; } 91 TMatrixDSym GetCovILC(){ return fCovILC; } 92 // 92 TMatrixDSym GetCovILC() { return fCovILC; } 93 // First hit 94 TVector3 GetFirstHit() { return fXfirst; } 93 95 }; 94 96 -
external/TrackCovariance/SolTrack.cc
r54ec182 r4564cba 176 176 { 177 177 // 178 // Return lists of hits associated to a track including all scattering layers. 178 // Return lists of hits associated to a track including all scattering layers. 179 179 // Return value is the total number of measurement hits 180 180 // kmh = total number of measurement layers hit for given type … … 190 190 { 191 191 Double_t R; Double_t phi; Double_t zz; 192 if (HitLayer(i, R, phi, zz)) 192 if (HitLayer(i, R, phi, zz)) 193 193 { 194 194 zhh[kh] = zz; … … 207 207 { 208 208 // 209 // Return lists of hits associated to a track for all measurement layers. 209 // Return lists of hits associated to a track for all measurement layers. 210 210 // Return value is the total number of measurement hits 211 211 // kmh = total number of measurement layers hit for given type … … 234 234 } 235 235 // 236 Int_t SolTrack::FirstHit(Double_t &Xfirst, Double_t &Yfirst, Double_t &Zfirst) 237 { 238 Int_t iFirst = -1; 239 Int_t iFirstLay = -1; // Default return with no hits 240 Xfirst = 0.; 241 Yfirst = 0.; 242 Zfirst = 0.; 243 Int_t Nmh = nmHit(); // # measurement hits 244 if(Nmh > 0){ 245 Int_t *ih = new Int_t [Nmh]; 246 Double_t *Xh = new Double_t[Nmh]; 247 Double_t *Yh = new Double_t[Nmh]; 248 Double_t *Zh = new Double_t[Nmh]; 249 Double_t *dh = new Double_t[Nmh]; 250 // 251 Int_t n = HitListXYZ(ih, Xh, Yh, Zh); 252 // 253 for(Int_t i=0; i<Nmh; i++){ 254 Double_t rr = TMath::Sqrt(Xh[i]*Xh[i]+Yh[i]*Yh[i]); // Hit radius 255 dh[i] = TMath::ASin(C() * TMath::Sqrt((rr * rr - D() * D()) / (1. + 2 * C() * D()))) / C(); // Arc length traveled 256 } 257 // 258 Int_t *hord = new Int_t[Nmh]; // hit order by increasing arc length 259 TMath::Sort(Nmh, dh, hord, kFALSE); // Order by increasing arc length 260 iFirst = hord[0]; // First hit pointer 261 Xfirst = Xh[iFirst]; 262 Yfirst = Yh[iFirst]; 263 Zfirst = Zh[iFirst]; 264 iFirstLay = ih[iFirst]; 265 // 266 // Clean 267 delete [] ih; 268 delete [] Xh; 269 delete [] Yh; 270 delete [] Zh; 271 delete [] dh; 272 delete [] hord; 273 } 274 // 275 return iFirstLay; // Return first hit layer number 276 } 277 // 236 278 // Track plot 237 279 // … … 285 327 // 286 328 // 287 // Input flags: 329 // Input flags: 288 330 // Res = .TRUE. turn on resolution effects/Use standard resolutions 289 331 // .FALSE. set all resolutions to 0 … … 368 410 nz = 1.0; 369 411 } 370 Double_t corr = TMath::Abs(pxi*nx + pyi * ny + pzi * nz) / p(); 412 Double_t corr = TMath::Abs(pxi*nx + pyi * ny + pzi * nz) / p(); 371 413 Double_t Rlf = fG->lTh(i) / (corr*fG->lX0(i)); // Rad. length fraction 372 414 thms[ii] = 0.0136*TMath::Sqrt(Rlf)*(1.0 + 0.038*TMath::Log(Rlf)) / p(); // MS angle … … 396 438 Int_t ityp = fG->lTyp(i); // Layer type Barrel or Z 397 439 Int_t nmeai = fG->lND(i); // # measurements in layer 398 440 399 441 if (fG->isMeasure(i)) 400 442 { … … 428 470 Rm(im, 2) = csa * dRphi(2) - ssa * dRz(2); // C derivative 429 471 Rm(im, 3) = csa * dRphi(3) - ssa * dRz(3); // z0 derivative 430 Rm(im, 4) = csa * dRphi(4) - ssa * dRz(4); // cot(theta) derivative 472 Rm(im, 4) = csa * dRphi(4) - ssa * dRz(4); // cot(theta) derivative 431 473 } 432 474 if (ityp == 2) // Z type layer (Measure R-phi at const. Z) … … 489 531 { 490 532 Double_t strk = 0; 491 if (nmk + 1 == 1) strk = fG->lStU(k); // Stereo angle upper 533 if (nmk + 1 == 1) strk = fG->lStU(k); // Stereo angle upper 492 534 if (nmk + 1 == 2) strk = fG->lStL(k); // Stereo angle lower 493 535 //if (im == km && Res) Sm(im, km) += sig*sig; // Detector resolution on diagonal … … 500 542 // 501 543 // Loop on all layers below for MS contributions 502 for (Int_t jj = 0; jj < kk; jj++) 544 for (Int_t jj = 0; jj < kk; jj++) 503 545 { 504 546 Double_t di = dik(ii, jj); -
external/TrackCovariance/SolTrack.h
r54ec182 r4564cba 73 73 Int_t HitList(Int_t *&ihh, Double_t *&rhh, Double_t *&zhh); 74 74 Int_t HitListXYZ(Int_t *&ihh, Double_t *&Xh, Double_t *&Yh, Double_t *&Zh); 75 Int_t FirstHit(Double_t &Xfirst, Double_t &Yfirst, Double_t &Zfirst); // First hit position 75 76 // 76 77 // Track graph -
external/TrackCovariance/VertexFit.cc
r54ec182 r4564cba 17 17 { 18 18 fNtr = 0; 19 fR old= -1.0;19 fRstart = -1.0; 20 20 fVtxDone = kFALSE; 21 21 fVtxCst = kFALSE; … … 31 31 { 32 32 fNtr = Ntr; 33 fR old= -1.0;33 fRstart = -1.0; 34 34 fVtxDone = kFALSE; 35 35 fVtxCst = kFALSE; … … 55 55 { 56 56 fNtr = Ntr; 57 fR old= -1.0;57 fRstart = -1.0; 58 58 fVtxDone = kFALSE; 59 59 fVtxCst = kFALSE; … … 220 220 std::vector<TVectorD*> x0i; // Tracks at ma 221 221 std::vector<TVectorD*> ni; // Track derivative wrt phase 222 std::vector<TMatrixDSym*> Ci; // Position error matrix at fixed phase222 std::vector<TMatrixDSym*> Ci; // Position error matrix at fixed phase 223 223 std::vector<TVectorD*> wi; // Ci*ni 224 std::vector<Double_t> s_in; // Starting phase 225 // 226 // 224 227 // 225 228 // Track loop 226 229 for (Int_t i = 0; i < fNtr; i++) 227 230 { 228 Double_t s = 0.;229 231 TVectorD par = *fPar[i]; 230 232 TMatrixDSym Cov = *fCov[i]; 231 x0i.push_back(new TVectorD(Fill_x0(par))); 233 Double_t s = 0.; 234 // Case when starting radius is provided 235 if(fRstart > TMath::Abs(par(0))){ 236 s = 2.*TMath::ASin(par(2)*TMath::Sqrt((fRstart*fRstart-par(0)*par(0))/(1.+2.*par(2)*par(0)))); 237 } 238 // 239 x0i.push_back(new TVectorD(Fill_x(par, s))); 232 240 ni.push_back(new TVectorD(derXds(par, s))); 233 241 TMatrixD A = derXdPar(par, s); … … 235 243 TMatrixDSym Cinv = RegInv(*Ci[i]); 236 244 wi.push_back(new TVectorD(Cinv * (*ni[i]))); 245 s_in.push_back(s); 237 246 } 238 247 //std::cout << "Vtx init completed. fNtr = "<<fNtr << std::endl; … … 262 271 for (Int_t i = 0; i < fNtr; i++){ 263 272 Double_t si = Dot(*wi[i], fXv - (*x0i[i])) / Ci[i]->Similarity(*wi[i]); 264 ffi.push_back(si );273 ffi.push_back(si+s_in[i]); 265 274 //TVectorD xvi = Fill_x(*fPar[i],si); 266 275 //std::cout << "Fast vertex "<<i<<": xvi = "<<xvi(0)<<", "<<xvi(1)<<", "<<xvi(2) … … 280 289 Ci.clear(); 281 290 wi.clear(); 291 s_in.clear(); 282 292 } 283 293 // … … 402 412 // 403 413 fVtxDone = kTRUE; // Set fit completion flag 404 fRold= TMath::Sqrt(fXv(0)*fXv(0) + fXv(1)*fXv(1)); // Store fit414 //fRstart = TMath::Sqrt(fXv(0)*fXv(0) + fXv(1)*fXv(1)); // Store fit 405 415 //std::cout << "Found vertex " << fXv(0) << ", " << fXv(1) << ", " << fXv(2) 406 416 // << ", after "<<Ntry<<" iterations"<<std::endl; -
external/TrackCovariance/VertexFit.h
r54ec182 r4564cba 36 36 // Results 37 37 Bool_t fVtxDone; // Flag vertex fit completed 38 Double_t fR old; // Current value of vertex radius38 Double_t fRstart; // Starting value of vertex radius (0 = none) 39 39 TVectorD fXv; // Found vertex 40 40 TMatrixDSym fcovXv; // Vertex covariance … … 83 83 // Handle tracks/constraints 84 84 void AddVtxConstraint(TVectorD xv, TMatrixDSym cov); // Add gaussian vertex constraint 85 void AddTrk(TVectorD *par, TMatrixDSym *Cov); // Add track to input list 86 void RemoveTrk(Int_t iTrk); // Remove iTrk track 85 void AddTrk(TVectorD *par, TMatrixDSym *Cov); // Add track to input list 86 void RemoveTrk(Int_t iTrk); // Remove iTrk track 87 void SetStartR(Double_t R) { fRstart = R; }; // Set starting radius 87 88 // 88 89 }; -
modules/ModulesLinkDef.h
r54ec182 r4564cba 79 79 #include "modules/TruthVertexFinder.h" 80 80 #include "modules/ExampleModule.h" 81 #include "modules/LLPFilter.h" 82 #include "modules/CscClusterEfficiency.h" 83 #include "modules/CscClusterId.h" 81 84 82 85 #ifdef __CINT__ … … 139 142 #pragma link C++ class TruthVertexFinder+; 140 143 #pragma link C++ class ExampleModule+; 144 #pragma link C++ class LLPFilter+; 145 #pragma link C++ class CscClusterEfficiency+; 146 #pragma link C++ class CscClusterId+; 141 147 142 148 #endif -
modules/TrackCovariance.cc
r54ec182 r4564cba 121 121 const TLorentzVector &candidateMomentum = particle->Momentum; 122 122 123 123 124 Bool_t inside = TrkUtil::IsInside(candidatePosition.Vect(), Rin, ZinNeg, ZinPos); // Check if in inner box 124 125 Bool_t Accept = kTRUE; … … 130 131 131 132 ObsTrk track(candidatePosition.Vect(), candidateMomentum.Vect(), candidate->Charge, fCovariance, fGeometry); 133 132 134 133 135 mother = candidate; … … 150 152 candidate->Yd = track.GetObsX().Y()*1e03; 151 153 candidate->Zd = track.GetObsX().Z()*1e03; 154 155 candidate->XFirstHit = track.GetFirstHit().X()*1e03; 156 candidate->YFirstHit = track.GetFirstHit().Y()*1e03; 157 candidate->ZFirstHit = track.GetFirstHit().Z()*1e03; 152 158 153 159 candidate->D0 = track.GetObsPar()[0]*1e03; -
modules/TreeWriter.cc
r54ec182 r4564cba 45 45 #include "TString.h" 46 46 47 #include <set> 47 48 #include <algorithm> 48 49 #include <iostream> … … 76 77 fClassMap[Electron::Class()] = &TreeWriter::ProcessElectrons; 77 78 fClassMap[Muon::Class()] = &TreeWriter::ProcessMuons; 79 fClassMap[CscCluster::Class()] = &TreeWriter::ProcessCscCluster; 78 80 fClassMap[Jet::Class()] = &TreeWriter::ProcessJets; 79 81 fClassMap[MissingET::Class()] = &TreeWriter::ProcessMissingET; … … 149 151 { 150 152 TIter it1(candidate->GetCandidates()); 153 set<Candidate *> s; 154 set<Candidate *>::iterator it3; 151 155 it1.Reset(); 156 s.clear(); 152 157 array->Clear(); 153 158 … … 159 164 if(candidate->GetCandidates()->GetEntriesFast() == 0) 160 165 { 161 array->Add(candidate);166 s.insert(candidate); 162 167 continue; 163 168 } … … 167 172 if(candidate->GetCandidates()->GetEntriesFast() == 0) 168 173 { 169 array->Add(candidate);174 s.insert(candidate); 170 175 continue; 171 176 } … … 175 180 while((candidate = static_cast<Candidate *>(it2.Next()))) 176 181 { 177 array->Add(candidate->GetCandidates()->At(0)); 182 candidate = static_cast<Candidate *>(candidate->GetCandidates()->At(0)); 183 if(candidate->GetCandidates()->GetEntriesFast() == 0) 184 { 185 s.insert(candidate); 186 } 178 187 } 188 } 189 190 for(it3 = s.begin(); it3 != s.end(); ++it3) 191 { 192 array->Add(*it3); 179 193 } 180 194 } … … 238 252 entry->Z = position.Z(); 239 253 entry->T = position.T() * 1.0E-3 / c_light; 254 240 255 } 241 256 } … … 384 399 entry->Zd = candidate->Zd; 385 400 401 entry->XFirstHit = candidate->XFirstHit; 402 entry->YFirstHit = candidate->YFirstHit; 403 entry->ZFirstHit = candidate->ZFirstHit; 404 386 405 const TLorentzVector &momentum = candidate->Momentum; 387 406 … … 544 563 entry->Zd = candidate->Zd; 545 564 565 entry->XFirstHit = candidate->XFirstHit; 566 entry->YFirstHit = candidate->YFirstHit; 567 entry->ZFirstHit = candidate->ZFirstHit; 568 546 569 const TLorentzVector &momentum = candidate->Momentum; 547 570 … … 886 909 } 887 910 } 911 //------------------------------------------------------------------------------ 912 913 void TreeWriter::ProcessCscCluster(ExRootTreeBranch *branch, TObjArray *array) 914 { 915 TIter iterator(array); 916 Candidate *candidate = 0; 917 CscCluster *entry = 0; 918 Double_t pt, signPz, cosTheta, eta, rapidity; 919 920 const Double_t c_light = 2.99792458E8; // in unit of m/s 921 922 array->Sort(); 923 924 925 // loop over all clusters 926 iterator.Reset(); 927 while((candidate = static_cast<Candidate *>(iterator.Next()))) 928 { 929 const TLorentzVector &momentum = candidate->Momentum; 930 const TLorentzVector &position = candidate->DecayPosition; 931 932 pt = momentum.Pt(); 933 cosTheta = TMath::Abs(momentum.CosTheta()); 934 signPz = (momentum.Pz() >= 0.0) ? 1.0 : -1.0; 935 eta = (cosTheta == 1.0 ? signPz * 999.9 : momentum.Eta()); 936 937 entry = static_cast<CscCluster *>(branch->NewEntry()); 938 939 entry->SetBit(kIsReferenced); 940 entry->SetUniqueID(candidate->GetUniqueID()); 941 942 entry->Eta = eta; 943 entry->Phi = momentum.Phi(); 944 945 entry->PT = momentum.Pt(); // pt of LLP 946 entry->Px = momentum.Px();// px of LLP 947 entry->Py = momentum.Py();// py of LLP 948 entry->Pz = momentum.Pz();// pz of LLP 949 entry->E = momentum.E(); // E of LLP 950 entry->pid = candidate->PID; // LLP pid 951 entry->Eem = candidate->Eem; // LLP Eem 952 entry->Ehad = candidate->Ehad; // LLP Ehad 953 Double_t beta = momentum.P()/momentum.E(); 954 Double_t gamma = 1.0/sqrt(1-beta*beta); 955 Double_t decayDistance = sqrt(pow(position.X(),2)+pow(position.Y(),2)+pow(position.Z(),2)); // mm 956 entry->beta = beta; // LLP pid 957 entry->ctau = decayDistance/(beta * gamma); // LLP travel time in its rest frame 958 entry->T = decayDistance*(1./beta-1)* 1.0E-3/c_light*1e9; // ns 959 entry->X = position.X(); // LLP decay x 960 entry->Y = position.Y(); // LLP decay y 961 entry->Z = position.Z(); // LLP decay z 962 } 963 } 888 964 889 965 //------------------------------------------------------------------------------ -
modules/TreeWriter.h
r54ec182 r4564cba 60 60 void ProcessElectrons(ExRootTreeBranch *branch, TObjArray *array); 61 61 void ProcessMuons(ExRootTreeBranch *branch, TObjArray *array); 62 void ProcessCscCluster(ExRootTreeBranch *branch, TObjArray *array); 62 63 void ProcessTauJets(ExRootTreeBranch *branch, TObjArray *array); 63 64 void ProcessJets(ExRootTreeBranch *branch, TObjArray *array); … … 67 68 void ProcessWeight(ExRootTreeBranch *branch, TObjArray *array); 68 69 void ProcessHectorHit(ExRootTreeBranch *branch, TObjArray *array); 70 69 71 70 72 #if !defined(__CINT__) && !defined(__CLING__)
Note:
See TracChangeset
for help on using the changeset viewer.