Fork me on GitHub

source: git/modules/ClusterCounting.cc@ 53f4746

Last change on this file since 53f4746 was d4fb268, checked in by michele <michele.selvaggi@…>, 4 years ago

added v0 of Ionisation cluster counting

  • Property mode set to 100644
File size: 4.0 KB
RevLine 
[d4fb268]1 /*
2 * Delphes: a framework for fast simulation of a generic collider experiment
3 * Copyright (C) 2020 Universite catholique de Louvain (UCLouvain), 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 ClusterCounting
20 *
21 * Counts ionisation clusters of energy loss in drift chambers
22 *
23 * \authors F. Bedeschi - INFN Pisa
24* P. Demin - UCLouvain, Louvain-la-Neuve
25 * M. Selvaggi - CERN
26 *
27 *
28 */
29
30//FIXME add reference to Bedeschi-code
31//FIXME make sure about units of P, X
32//FIXME fix pt > 200 GeV issue and angle > 6.41
33
34#include "modules/ClusterCounting.h"
35
36#include "classes/DelphesClasses.h"
37#include "TrackCovariance/TrkUtil.h"
38
39#include "TLorentzVector.h"
40#include "TVectorD.h"
41#include "TMath.h"
42#include "TObjArray.h"
43
44#include <iostream>
45#include <sstream>
46
47using namespace std;
48
49//------------------------------------------------------------------------------
50
51ClusterCounting::ClusterCounting() :
52 fTrackUtil(0)
53{
54 fTrackUtil = new TrkUtil();
55}
56
57//------------------------------------------------------------------------------
58
59ClusterCounting::~ClusterCounting()
60{
61 if(fTrackUtil) delete fTrackUtil;
62}
63
64//------------------------------------------------------------------------------
65
66void ClusterCounting::Init()
67{
68
69 // geometric acceptance
70 fRmin = GetDouble("Rmin", 0.);
71 fRmax = GetDouble("Rmax", 0.);
72 fZmin = GetDouble("Zmin", 0.);
73 fZmax = GetDouble("Zmax", 0.);
74
75 // magnetic field
76 fBz = GetDouble("Bz", 0.);
77
78 // gas mix option: 0
79 // 0: Helium 90 - Isobutane 10
80 // 1: Helium 100
81 // 2: Argon 50 - Ethane 50
82 // 3: Argon 100
83 fGasOption = GetInt("GasOption", 0);
84
85 // initialize drift chamber geometry and gas mix
86 fTrackUtil->SetBfield(fBz);
87 fTrackUtil->SetDchBoundaries(fRmin, fRmax, fZmin, fZmax);
88 fTrackUtil->SetGasMix(fGasOption);
89
90 // import input array
91 fInputArray = ImportArray(GetString("InputArray", "TrackMerger/tracks"));
92 fItInputArray = fInputArray->MakeIterator();
93
94 // create output array
95 fOutputArray = ExportArray(GetString("OutputArray", "tracks"));
96}
97
98//------------------------------------------------------------------------------
99
100void ClusterCounting::Finish()
101{
102 if(fItInputArray) delete fItInputArray;
103}
104
105//------------------------------------------------------------------------------
106
107void ClusterCounting::Process()
108{
109 Candidate *candidate, *mother, *particle;
110 Double_t mass, Ncl;
111
112 fItInputArray->Reset();
113 while((candidate = static_cast<Candidate *>(fItInputArray->Next())))
114 {
115
116 // converting to meters
117 particle = static_cast<Candidate *>(candidate->GetCandidates()->At(0));
118
119 // converting to meters
120 const TLorentzVector &candidatePosition = particle->Position*1e-03;
121 const TLorentzVector &candidateMomentum = particle->Momentum;
122
123 TVectorD Par = TrkUtil::XPtoPar(candidatePosition.Vect(), candidateMomentum.Vect(), candidate->Charge, fBz);
124 mass = candidateMomentum.M();
125
126 mother = candidate;
127 candidate = static_cast<Candidate*>(candidate->Clone());
128
129 Ncl = -999;
130 // computation of Nclusters is not supported for electrons
131 if (TMath::Abs(particle->PID) == 11)
132 {
133 candidate->Nclusters = Ncl;
134 }
135 else if (fTrackUtil->IonClusters(Ncl, mass, Par))
136 {
137 candidate->Nclusters = Ncl;
138 }
139 //cout<<candidate->PID<<", "<<mass<<", "<<candidate->Nclusters<<endl;
140
141 candidate->AddCandidate(mother);
142
143 fOutputArray->Add(candidate);
144 }
145}
146
147//------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.