Skip to content

Commit 79971c0

Browse files
Add parametrised response for preshower detector
1 parent 0df8365 commit 79971c0

File tree

3 files changed

+120
-0
lines changed

3 files changed

+120
-0
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set(SOURCES
77
TOFLayer.cc
88
RICHdetector.cc
99
MIDdetector.cc
10+
PreShower.cc
1011
)
1112

1213
set(HEADERS
@@ -16,6 +17,7 @@ set(HEADERS
1617
TOFLayer.hh
1718
RICHdetector.hh
1819
MIDdetector.hh
20+
PreShower.hh
1921
)
2022

2123
get_target_property(DELPHES_INCLUDE_DIRECTORIES

src/PreShower.cc

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/// @author: Roberto Preghenella
2+
/// @email: [email protected]
3+
4+
/// @author: Antonio Uras
5+
/// @email: [email protected]
6+
7+
/// @author: Marco van Leeuwen
8+
/// @email: [email protected]
9+
10+
#include "PreShower.hh"
11+
#include "TDatabasePDG.h"
12+
#include "THnSparse.h"
13+
#include "TRandom.h"
14+
#include "TDatime.h"
15+
#include "TFile.h"
16+
#include "TVector3.h"
17+
#include "TMath.h"
18+
#include "TAxis.h"
19+
20+
namespace o2 {
21+
namespace delphes {
22+
23+
//==========================================================================================================
24+
25+
bool PreShower::setup() {
26+
27+
TDatime t;
28+
gRandom->SetSeed(t.GetDate()+t.GetYear()*t.GetHour()*t.GetMinute()*t.GetSecond()); // NB: gRandom is a global pointer ?
29+
for (Int_t iPart = 0; iPart < kNPart; iPart++) {
30+
mMomMin[iPart] = 0.1;
31+
mMomMax[iPart] = 20;
32+
}
33+
34+
return kTRUE;
35+
36+
}
37+
38+
//==========================================================================================================
39+
40+
bool PreShower::hasPreShower(const Track &track) {
41+
42+
auto pdg = std::abs(track.PID);
43+
auto part = pidmap[pdg];
44+
return ((TMath::Abs(track.Eta) < mEtaMax) && (track.P > mMomMin[part]));
45+
46+
}
47+
48+
//==========================================================================================================
49+
50+
bool PreShower::isElectron(const Track &track, int multiplicity=1) {
51+
52+
auto pdg = std::abs(track.PID);
53+
auto part = pidmap[pdg];
54+
if (part == kElectron) {
55+
// Parametrisation of preshower detector studies without charge sharing
56+
float eff = 0.8*(1.-exp(1.6*(track.P-0.05)));
57+
return (gRandom->Uniform() < eff);
58+
}
59+
else {
60+
const Float_t misTagProb = 0.001;
61+
return (gRandom->Uniform() < misTagProb);
62+
}
63+
}
64+
65+
//==========================================================================================================
66+
67+
} /** namespace delphes **/
68+
69+
} /** namespace o2 **/

src/PreShower.hh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/// @author: Roberto Preghenella
2+
/// @email: [email protected]
3+
4+
/// @author: Antonio Uras
5+
/// @email: [email protected]
6+
7+
/// @author: Marco van Leeuwen
8+
/// @email: [email protected]
9+
10+
#ifndef _DelphesO2_PreShower_h_
11+
#define _DelphesO2_PreShower_h_
12+
13+
#include "classes/DelphesClasses.h"
14+
#include "THnSparse.h"
15+
#include "TFile.h"
16+
17+
#include <map>
18+
using namespace std;
19+
20+
namespace o2 {
21+
namespace delphes {
22+
23+
class PreShower {
24+
25+
public:
26+
PreShower() = default;
27+
~PreShower() = default;
28+
29+
enum { kElectron, kMuon, kPion, kKaon, kProton, kNPart }; // primary particles with a non-zero muon PID probability
30+
31+
bool setup();
32+
bool hasPreShower(const Track &track);
33+
bool isElectron(const Track &track, int multiplicity);
34+
35+
protected:
36+
37+
const double mEtaMax = 1.75;
38+
double mMomMin[kNPart];
39+
double mMomMax[kNPart];
40+
const char *partLabel[kNPart] = {"electron","muon","pion","kaon","proton"};
41+
std::map<int, int> pidmap = { {11, kElectron}, {13, kMuon}, {211, kPion}, {321, kKaon}, {2212, kProton} };
42+
43+
};
44+
45+
} /** namespace delphes **/
46+
} /** namespace o2 **/
47+
48+
#endif /** _DelphesO2_MIDLayer_h_ **/
49+

0 commit comments

Comments
 (0)