Fork me on GitHub

Changeset a5af1df in git


Ignore:
Timestamp:
Dec 9, 2021, 7:38:54 AM (3 years ago)
Author:
christinaw97 <christina.wang@…>
Children:
d612dec
Parents:
a5ff49f
Message:

added CscCluster modules and classes

Files:
7 added
7 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    ra5ff49f ra5af1df  
    2222HAS_CMSSW = true
    2323CXXFLAGS += -std=c++0x -I$(subst :, -I,$(CMSSW_FWLITE_INCLUDE_PATH))
     24CXXFLAGS += -std=c++1y
    2425OPT_LIBS += -L$(subst include,lib,$(subst :, -L,$(CMSSW_FWLITE_INCLUDE_PATH)))
    2526ifneq ($(CMSSW_RELEASE_BASE),)
     
    444445        modules/VertexFinder.h \
    445446        modules/VertexFinderDA4D.h \
    446         modules/ExampleModule.h
     447        modules/ExampleModule.h \
     448        modules/LLPFilter.h \
     449        modules/CscClusterEfficiency.h \
     450        modules/CscClusterId.h
    447451tmp/modules/ModulesDict$(PcmSuf): \
    448452        tmp/modules/ModulesDict.$(SrcSuf)
     
    695699        external/ExRootAnalysis/ExRootFilter.h \
    696700        external/ExRootAnalysis/ExRootResult.h
     701tmp/modules/CscClusterEfficiency.$(ObjSuf): \
     702        modules/CscClusterEfficiency.$(SrcSuf) \
     703        modules/CscClusterEfficiency.h \
     704        classes/DelphesClasses.h \
     705        classes/DelphesFactory.h \
     706        classes/DelphesFormula.h \
     707        external/ExRootAnalysis/ExRootClassifier.h \
     708        external/ExRootAnalysis/ExRootFilter.h \
     709        external/ExRootAnalysis/ExRootResult.h
     710tmp/modules/CscClusterId.$(ObjSuf): \
     711        modules/CscClusterId.$(SrcSuf) \
     712        modules/CscClusterId.h \
     713        classes/DelphesClasses.h \
     714        classes/DelphesFactory.h \
     715        classes/DelphesFormula.h \
     716        external/ExRootAnalysis/ExRootClassifier.h \
     717        external/ExRootAnalysis/ExRootFilter.h \
     718        external/ExRootAnalysis/ExRootResult.h
    697719tmp/modules/Delphes.$(ObjSuf): \
    698720        modules/Delphes.$(SrcSuf) \
     
    820842        modules/JetPileUpSubtractor.$(SrcSuf) \
    821843        modules/JetPileUpSubtractor.h \
     844        classes/DelphesClasses.h \
     845        classes/DelphesFactory.h \
     846        classes/DelphesFormula.h \
     847        external/ExRootAnalysis/ExRootClassifier.h \
     848        external/ExRootAnalysis/ExRootFilter.h \
     849        external/ExRootAnalysis/ExRootResult.h
     850tmp/modules/LLPFilter.$(ObjSuf): \
     851        modules/LLPFilter.$(SrcSuf) \
     852        modules/LLPFilter.h \
    822853        classes/DelphesClasses.h \
    823854        classes/DelphesFactory.h \
     
    11271158        tmp/modules/Cloner.$(ObjSuf) \
    11281159        tmp/modules/ConstituentFilter.$(ObjSuf) \
     1160        tmp/modules/CscClusterEfficiency.$(ObjSuf) \
     1161        tmp/modules/CscClusterId.$(ObjSuf) \
    11291162        tmp/modules/Delphes.$(ObjSuf) \
    11301163        tmp/modules/DenseTrackFilter.$(ObjSuf) \
     
    11411174        tmp/modules/JetFlavorAssociation.$(ObjSuf) \
    11421175        tmp/modules/JetPileUpSubtractor.$(ObjSuf) \
     1176        tmp/modules/LLPFilter.$(ObjSuf) \
    11431177        tmp/modules/LeptonDressing.$(ObjSuf) \
    11441178        tmp/modules/Merger.$(ObjSuf) \
     
    18231857        @touch $@
    18241858
     1859modules/LLPFilter.h: \
     1860        classes/DelphesModule.h
     1861        @touch $@
     1862
    18251863external/fastjet/internal/MinHeap.hh: \
    18261864        external/fastjet/internal/base.hh
     
    21362174        @touch $@
    21372175
     2176modules/CscClusterEfficiency.h: \
     2177        classes/DelphesModule.h
     2178        @touch $@
     2179
    21382180external/fastjet/PseudoJetStructureBase.hh: \
    21392181        external/fastjet/internal/base.hh
     
    22522294external/fastjet/config.h: \
    22532295        external/fastjet/config_win.h
     2296        @touch $@
     2297
     2298modules/CscClusterId.h: \
     2299        classes/DelphesModule.h
    22542300        @touch $@
    22552301
  • classes/ClassesLinkDef.h

    ra5ff49f ra5af1df  
    5757#pragma link C++ class Electron+;
    5858#pragma link C++ class Muon+;
     59#pragma link C++ class CscCluster+;
     60
    5961#pragma link C++ class Jet+;
    6062#pragma link C++ class Track+;
     
    6567
    6668#endif
    67 
  • classes/DelphesClasses.cc

    ra5ff49f ra5af1df  
    3636CompBase *Electron::fgCompare = CompPT<Electron>::Instance();
    3737CompBase *Muon::fgCompare = CompPT<Muon>::Instance();
     38
    3839CompBase *Jet::fgCompare = CompPT<Jet>::Instance();
    3940CompBase *Track::fgCompare = CompPT<Track>::Instance();
     
    4243CompBase *Vertex::fgCompare = CompSumPT2<Vertex>::Instance();
    4344CompBase *Candidate::fgCompare = CompMomentumPt<Candidate>::Instance();
     45CompBase *CscCluster::fgCompare = CompE<CscCluster>::Instance();
    4446
    4547//------------------------------------------------------------------------------
     
    128130  Position(0.0, 0.0, 0.0, 0.0),
    129131  InitialPosition(0.0, 0.0, 0.0, 0.0),
     132  DecayPosition(0.0, 0.0, 0.0, 0.0),
    130133  PositionError(0.0, 0.0, 0.0, 0.0),
    131134  Area(0.0, 0.0, 0.0, 0.0),
     
    290293  object.Position = Position;
    291294  object.InitialPosition = InitialPosition;
     295  object.DecayPosition = DecayPosition;
    292296  object.PositionError = PositionError;
    293297  object.Area = Area;
     
    418422  Position.SetXYZT(0.0, 0.0, 0.0, 0.0);
    419423  InitialPosition.SetXYZT(0.0, 0.0, 0.0, 0.0);
     424  DecayPosition.SetXYZT(0.0, 0.0, 0.0, 0.0);
    420425  Area.SetXYZT(0.0, 0.0, 0.0, 0.0);
    421426  L = 0.0;
  • classes/DelphesClasses.h

    ra5ff49f ra5af1df  
    162162  Float_t Z; // particle vertex position (z component) | hepevt.vhep[number][2]
    163163
     164  Float_t decayX;
     165  Float_t decayY;
     166  Float_t decayZ;
     167  Float_t decayT;
     168
     169  Float_t ctau;
     170
    164171  static CompBase *fgCompare; //!
    165172  const CompBase *GetCompare() const { return fgCompare; }
     
    533540  ClassDef(HectorHit, 1)
    534541};
     542//---------------------------------------------------------------------------
     543
     544class CscCluster: public SortableObject
     545{
     546public:
     547  Int_t NHits; //nCSC hits
     548  Float_t Eta; // eta of LLP
     549  Float_t Phi; // phi of LLP
     550  Float_t PT; // pt of LLP
     551  Float_t Px;// px of LLP
     552  Float_t Py;// py of LLP
     553  Float_t Pz;// pz of LLP
     554  Float_t E; // E of LLP
     555  Float_t Ehad; // had energy of LLP
     556  Float_t Eem; // em energy of LLP
     557
     558  Float_t pid; // LLP pid
     559
     560  Float_t T; // LLP decay time-photon travel time
     561  Float_t X; // LLP decay x
     562  Float_t Y; //  LLP decay y
     563  Float_t Z; //  LLP decay z
     564  Float_t R; //  LLP decay z
     565  Float_t beta;
     566  Float_t ctau;
     567
     568
     569  static CompBase *fgCompare; //!
     570  const CompBase *GetCompare() const { return fgCompare; }
     571
     572  ClassDef(CscCluster, 4)
     573};
    535574
    536575//---------------------------------------------------------------------------
     
    576615  Float_t DeltaPhi;
    577616
    578   TLorentzVector Momentum, Position, InitialPosition, PositionError, Area;
     617  TLorentzVector Momentum, Position, InitialPosition, DecayPosition, PositionError, Area;
    579618
    580619  Float_t L; // path length
  • modules/ModulesLinkDef.h

    ra5ff49f ra5af1df  
    7373#include "modules/VertexFinderDA4D.h"
    7474#include "modules/ExampleModule.h"
     75#include "modules/LLPFilter.h"
     76#include "modules/CscClusterEfficiency.h"
     77#include "modules/CscClusterId.h"
    7578
    7679#ifdef __CINT__
     
    127130#pragma link C++ class VertexFinderDA4D+;
    128131#pragma link C++ class ExampleModule+;
     132#pragma link C++ class LLPFilter+;
     133#pragma link C++ class CscClusterEfficiency+;
     134#pragma link C++ class CscClusterId+;
    129135
    130136#endif
  • modules/TreeWriter.cc

    ra5ff49f ra5af1df  
    7575  fClassMap[Electron::Class()] = &TreeWriter::ProcessElectrons;
    7676  fClassMap[Muon::Class()] = &TreeWriter::ProcessMuons;
     77  fClassMap[CscCluster::Class()] = &TreeWriter::ProcessCscCluster;
    7778  fClassMap[Jet::Class()] = &TreeWriter::ProcessJets;
    7879  fClassMap[MissingET::Class()] = &TreeWriter::ProcessMissingET;
     
    182183    const TLorentzVector &momentum = candidate->Momentum;
    183184    const TLorentzVector &position = candidate->Position;
     185    const TLorentzVector &DecayPosition = candidate->DecayPosition;
    184186
    185187    entry = static_cast<GenParticle *>(branch->NewEntry());
     
    215217    entry->D0 = candidate->D0;
    216218    entry->DZ = candidate->DZ;
    217     entry->P = candidate->P;
     219    entry->P = momentum.P();
    218220    entry->PT = candidate->PT;
    219221    entry->CtgTheta = candidate->CtgTheta;
     
    230232    entry->Z = position.Z();
    231233    entry->T = position.T() * 1.0E-3 / c_light;
     234
     235    entry->decayX = DecayPosition.X();
     236    entry->decayY = DecayPosition.Y();
     237    entry->decayZ = DecayPosition.Z();
     238    entry->decayT = DecayPosition.T()* 1.0E-3 / c_light;
     239    float beta = entry->P/momentum.E();
     240    float gamma = 1./sqrt(1-beta*beta);
     241    entry->ctau = sqrt(pow(entry->decayX-entry->X,2)+pow(entry->decayY-entry->Y,2)+pow(entry->decayZ-entry->Z,2))/(beta*gamma);// in millimeter
    232242  }
    233243}
     
    730740  }
    731741}
     742//------------------------------------------------------------------------------
     743
     744void TreeWriter::ProcessCscCluster(ExRootTreeBranch *branch, TObjArray *array)
     745{
     746  TIter iterator(array);
     747  Candidate *candidate = 0;
     748  CscCluster *entry = 0;
     749  Double_t pt, signPz, cosTheta, eta, rapidity;
     750
     751  const Double_t c_light = 2.99792458E8; // in unit of m/s
     752
     753  array->Sort();
     754
     755
     756  // loop over all clusters
     757  iterator.Reset();
     758  while((candidate = static_cast<Candidate *>(iterator.Next())))
     759  {
     760    const TLorentzVector &momentum = candidate->Momentum;
     761    const TLorentzVector &position = candidate->DecayPosition;
     762
     763    pt = momentum.Pt();
     764    cosTheta = TMath::Abs(momentum.CosTheta());
     765    signPz = (momentum.Pz() >= 0.0) ? 1.0 : -1.0;
     766    eta = (cosTheta == 1.0 ? signPz * 999.9 : momentum.Eta());
     767
     768    entry = static_cast<CscCluster *>(branch->NewEntry());
     769
     770    entry->SetBit(kIsReferenced);
     771    entry->SetUniqueID(candidate->GetUniqueID());
     772
     773    entry->Eta = eta;
     774    entry->Phi = momentum.Phi();
     775
     776
     777    // entry->Eta = position.Eta();
     778    // entry->Phi = position.Phi();
     779
     780    entry->PT = momentum.Pt(); // pt of LLP
     781    entry->Px = momentum.Px();// px of LLP
     782    entry->Py = momentum.Py();// py of LLP
     783    entry->Pz = momentum.Pz();// pz of LLP
     784    entry->E = momentum.E(); // E of LLP
     785    entry->pid = candidate->PID; // LLP pid
     786    entry->Eem = candidate->Eem; // LLP pid
     787    entry->Ehad = candidate->Ehad; // LLP pid
     788    Double_t beta = momentum.P()/momentum.E();
     789    Double_t gamma = 1.0/sqrt(1-beta*beta);
     790    Double_t decayDistance = sqrt(pow(position.X(),2)+pow(position.Y(),2)+pow(position.Z(),2)); // mm
     791    entry->beta = beta; // LLP pid
     792    entry->ctau = decayDistance/(beta * gamma);; // LLP pid
     793
     794    // entry->T = (position.T()-sqrt(pow(position.X(),2)+pow(position.Y(),2)+pow(position.Z(),2)))* 1.0E-3 / c_light; // LLP decay time-photon travel time
     795
     796    entry->T = decayDistance*(1./beta-1)* 1.0E-3/c_light*1e9; // ns
     797    entry->X = position.X(); // LLP decay x
     798    entry->Y = position.Y(); //  LLP decay y
     799    entry->Z = position.Z(); //  LLP decay z
     800    // entry->Size = 100;
     801  }
     802}
    732803
    733804//------------------------------------------------------------------------------
  • modules/TreeWriter.h

    ra5ff49f ra5af1df  
    5959  void ProcessElectrons(ExRootTreeBranch *branch, TObjArray *array);
    6060  void ProcessMuons(ExRootTreeBranch *branch, TObjArray *array);
     61  void ProcessCscCluster(ExRootTreeBranch *branch, TObjArray *array);
    6162  void ProcessTauJets(ExRootTreeBranch *branch, TObjArray *array);
    6263  void ProcessJets(ExRootTreeBranch *branch, TObjArray *array);
     
    6667  void ProcessWeight(ExRootTreeBranch *branch, TObjArray *array);
    6768  void ProcessHectorHit(ExRootTreeBranch *branch, TObjArray *array);
     69
    6870
    6971#if !defined(__CINT__) && !defined(__CLING__)
Note: See TracChangeset for help on using the changeset viewer.