Fork me on GitHub

source: git/modules/CscClusterId.cc@ 4564cba

Last change on this file since 4564cba was cc8716b, checked in by GitHub <noreply@…>, 3 years ago

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

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

  • Property mode set to 100644
File size: 4.3 KB
Line 
1/*
2 * Delphes: a framework for fast simulation of a generic collider experiment
3 * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 /** \class CscClusterId
20 *
21 * This module is specific to the CMS paper searching for neutral LLPs in the CMS endcap muon detectors: https://arxiv.org/abs/2107.04838
22 * It is implemented based on the cut_based_id.py function provided in the HEPData entry of the paper: https://www.hepdata.net/record/104408
23 * to reproduce the cut-based ID efficiency of the CMS paper.
24 *
25 * \author Christina Wang
26 *
27 */
28
29#include "modules/CscClusterId.h"
30
31#include "classes/DelphesClasses.h"
32#include "classes/DelphesFactory.h"
33#include "classes/DelphesCscClusterFormula.h"
34
35#include "ExRootAnalysis/ExRootClassifier.h"
36#include "ExRootAnalysis/ExRootFilter.h"
37#include "ExRootAnalysis/ExRootResult.h"
38
39#include "TDatabasePDG.h"
40#include "TFormula.h"
41#include "TLorentzVector.h"
42#include "TMath.h"
43#include "TObjArray.h"
44#include "TRandom3.h"
45#include "TString.h"
46
47#include <algorithm>
48#include <iostream>
49#include <sstream>
50#include <stdexcept>
51#include "assert.h"
52using namespace std;
53
54//------------------------------------------------------------------------------
55
56CscClusterId::CscClusterId() :
57 fFormula(0), fEtaFormula(0), fItInputArray(0)
58{
59 fFormula = new DelphesCscClusterFormula;
60 fEtaFormula = new DelphesCscClusterFormula;
61}
62
63//------------------------------------------------------------------------------
64
65CscClusterId::~CscClusterId()
66{
67 if(fFormula) delete fFormula;
68 if(fEtaFormula) delete fEtaFormula;
69}
70
71//------------------------------------------------------------------------------
72
73void CscClusterId::Init()
74{
75 // read efficiency formula
76
77 fFormula->Compile(GetString("EfficiencyFormula", "1.0"));
78 fEtaFormula->Compile(GetString("EtaCutFormula", "1.0"));
79 fEtaCutMax = GetDouble("EtaCutMax", 999.0);
80
81 // import input array
82
83 fInputArray = ImportArray(GetString("InputArray", "ParticlePropagator/stableParticles"));
84 fItInputArray = fInputArray->MakeIterator();
85
86 // create output array
87
88 fOutputArray = ExportArray(GetString("OutputArray", "stableParticles"));
89}
90
91//------------------------------------------------------------------------------
92
93void CscClusterId::Finish()
94{
95 if(fItInputArray) delete fItInputArray;
96}
97
98//------------------------------------------------------------------------------
99
100void CscClusterId::Process()
101{
102 Candidate *candidate;
103 Double_t Ehad, Eem, decayR, decayZ, NStationEff, eta, eta_cut;
104 Int_t avgStation;
105 Double_t signPz, cosTheta;
106
107 fItInputArray->Reset();
108 while((candidate = static_cast<Candidate *>(fItInputArray->Next())))
109 {
110 const TLorentzVector &momentum = candidate->Momentum;
111 const TLorentzVector &candidateDecayPosition = candidate->DecayPosition;
112 decayZ = abs(candidateDecayPosition.Z());
113 decayR = sqrt(pow(candidateDecayPosition.X(),2)+pow(candidateDecayPosition.Y(),2));
114 Ehad = candidate->Ehad;
115 Eem = candidate->Eem;
116
117 cosTheta = TMath::Abs(momentum.CosTheta());
118 signPz = (momentum.Pz() >= 0.0) ? 1.0 : -1.0;
119 eta = (cosTheta == 1.0 ? signPz * 999.9 : momentum.Eta());
120
121 // calculate the NStation > 1 efficiency, implemented according to Additional Figure 8 in HEPData
122 NStationEff = fFormula->Eval(decayR, decayZ, Ehad);
123
124 // depending on the decay region (station Number), different eta cut is applied, implemented based on cut_based_id.py in HEPData
125 float eta_cut = fEtaFormula->Eval(decayR, decayZ);
126 if(gRandom->Uniform() > NStationEff*(abs(eta)<fEtaCutMax)+(1.0-NStationEff)*(abs(eta)<eta_cut)) continue;
127
128 fOutputArray->Add(candidate);
129 }
130}
131
132//------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.