Fork me on GitHub

Changeset a5af1df in git for modules


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

Location:
modules
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • 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.