Fork me on GitHub

Changeset cc8716b in git for modules


Ignore:
Timestamp:
Mar 7, 2022, 8:51:45 PM (3 years ago)
Author:
GitHub <noreply@…>
Branches:
master
Children:
7dbc149
Parents:
4e8e72b
git-author:
Christinaw97 <cwang5@…> (03/07/22 20:51:45)
git-committer:
GitHub <noreply@…> (03/07/22 20:51:45)
Message:

Update to handle CMS endcap muon detector showers for long-lived particles (#103)

Co-authored-by: christinaw97 <christina.wang@…>

Location:
modules
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • modules/ModulesLinkDef.h

    r4e8e72b rcc8716b  
    7979#include "modules/TruthVertexFinder.h"
    8080#include "modules/ExampleModule.h"
     81#include "modules/LLPFilter.h"
     82#include "modules/CscClusterEfficiency.h"
     83#include "modules/CscClusterId.h"
    8184
    8285#ifdef __CINT__
     
    139142#pragma link C++ class TruthVertexFinder+;
    140143#pragma link C++ class ExampleModule+;
     144#pragma link C++ class LLPFilter+;
     145#pragma link C++ class CscClusterEfficiency+;
     146#pragma link C++ class CscClusterId+;
    141147
    142148#endif
  • modules/TreeWriter.cc

    r4e8e72b rcc8716b  
    7777  fClassMap[Electron::Class()] = &TreeWriter::ProcessElectrons;
    7878  fClassMap[Muon::Class()] = &TreeWriter::ProcessMuons;
     79  fClassMap[CscCluster::Class()] = &TreeWriter::ProcessCscCluster;
    7980  fClassMap[Jet::Class()] = &TreeWriter::ProcessJets;
    8081  fClassMap[MissingET::Class()] = &TreeWriter::ProcessMissingET;
     
    251252    entry->Z = position.Z();
    252253    entry->T = position.T() * 1.0E-3 / c_light;
     254
    253255  }
    254256}
     
    907909  }
    908910}
     911//------------------------------------------------------------------------------
     912
     913void 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}
    909964
    910965//------------------------------------------------------------------------------
  • modules/TreeWriter.h

    r4e8e72b rcc8716b  
    6060  void ProcessElectrons(ExRootTreeBranch *branch, TObjArray *array);
    6161  void ProcessMuons(ExRootTreeBranch *branch, TObjArray *array);
     62  void ProcessCscCluster(ExRootTreeBranch *branch, TObjArray *array);
    6263  void ProcessTauJets(ExRootTreeBranch *branch, TObjArray *array);
    6364  void ProcessJets(ExRootTreeBranch *branch, TObjArray *array);
     
    6768  void ProcessWeight(ExRootTreeBranch *branch, TObjArray *array);
    6869  void ProcessHectorHit(ExRootTreeBranch *branch, TObjArray *array);
     70
    6971
    7072#if !defined(__CINT__) && !defined(__CLING__)
Note: See TracChangeset for help on using the changeset viewer.