 |
Belle II Software
release-05-02-19
|
11 #include <tracking/modules/trackingPerformanceEvaluation/HitXPModule.h>
12 #include <framework/datastore/StoreArray.h>
13 #include <framework/datastore/RelationArray.h>
14 #include <mdst/dataobjects/MCParticle.h>
15 #include <svd/dataobjects/SVDCluster.h>
16 #include <svd/dataobjects/SVDTrueHit.h>
18 #include <tracking/dataobjects/RecoTrack.h>
19 #include <tracking/dataobjects/hitXPDerivate.h>
29 setDescription(
"This module builds a ttree with true hit informations (momentum, position, PDGID, and track parameters hit per hit) running over simulated and reconstructed events.");
32 addParam(
"additionalTree", c_addTree,
33 "produce two additional tree with reduced date: selTree (track with at least one hit per layer), tiSelTree (track with one hit per layer)",
39 HitXPModule::~HitXPModule()
55 storeClusters.isRequired();
56 storeTrueHits.isRequired();
57 storeMCParticles.isRequired();
58 recoTracks.isRequired();
61 RelationArray relClusterTrueHits(storeClusters, storeTrueHits);
62 RelationArray relClusterMCParticles(storeClusters, storeMCParticles);
63 RelationArray recoTracksToMCParticles(recoTracks , storeMCParticles);
75 m_outputFile =
new TFile(
"TFile_hitXP.root",
"RECREATE");
76 m_tree =
new TTree(
"TTree_hitXP",
"TTree_hitXP");
90 m_treeSel =
new TTree(
"TTree_hitXPSel",
"TTree_hitXPSel");
102 m_treeTiSel =
new TTree(
"TTree_hitXPTiSel",
"TTree_hitXPTiSel");
116 m_treeExt =
new TTree(
"TTree_hitXP_ext",
"TTree_hitXP_ext");
174 for (
const MCParticle& particle : MCParticles) {
177 if (hit.getRelationsFrom<
SVDCluster>().size() > 0) {
178 VxdID trueHitSensorID = hit.getSensorID();
185 if (Ncluster.isUCluster()) NClusterU++;
188 entry.setClusterU(NClusterU);
189 entry.setClusterV(NClusterV);
191 bool isReconstructed(
false);
193 isReconstructed |= aRecoTrack.hasSVDHits();
194 entry.setReconstructed(isReconstructed);
215 m_EPDGID.push_back(element.m_PDGID);
222 m_Etime.push_back(element.m_time);
231 m_Eomega0.push_back(element.getOmega0());
233 m_Ed00.push_back(element.getD00());
235 m_Ephi00.push_back(element.getPhi00());
237 m_Ez00.push_back(element.getZ00());
290 int f3 = 0, f4 = 0, f5 = 0, f6 = 0;
294 std::vector<hitXP> temp_hitXP;
295 while (j <
m_hitXP.size() && brk == 0) {
296 if (
m_hitXP[j].m_sensorLayer == 3) {
298 temp_hitXP.push_back(
m_hitXP[j]);
300 while (j <
m_hitXP.size() && brk == 0) {
301 if (
m_hitXP[j].m_sensorLayer == 4) {
303 temp_hitXP.push_back(
m_hitXP[j]);
305 while (j <
m_hitXP.size() && brk == 0) {
306 if (
m_hitXP[j].m_sensorLayer == 5) {
308 temp_hitXP.push_back(
m_hitXP[j]);
310 while (j <
m_hitXP.size() && brk == 0) {
311 if (
m_hitXP[j].m_sensorLayer == 6) {
313 temp_hitXP.push_back(
m_hitXP[j]);
328 layer_flag = f3 * f4 * f5 * f6;
329 if (layer_flag != 0) {
331 for (k = 0; k < 4; k = k + 1) {
348 &&
m_hitXP[2].m_sensorLayer == 5 &&
m_hitXP[3].m_sensorLayer == 6) {
350 for (h = 0; h < 4; h = h + 1) {
std::vector< double > m_Ephi0Entry
external phi0 parameter at entry point
void initialize() override
Initialize the Module.
int m_trackNumberTiSel
tight selected iterative number of the track in the run
Low-level class to create/modify relations between StoreArrays.
void endRun() override
This method is called if the current run ends.
std::vector< double > m_EpositionLocalEntryX
exteral local position at entry point, coordinate x
Class to uniquely identify a any structure of the PXD and SVD.
std::vector< hitXP > m_hitXP
vector of the hitXP, used to fill the output tree
std::vector< double > m_Ez0Entry
external z0 parameter at entry point
TFile * m_outputFile
output file
std::vector< double > m_EpositionLocalEntryY
exteral local position at entry point, coordinate y
std::vector< double > m_EpositionEntryX
exteral position at entry point, coordinate x
TFile * m_outputFileExt
external output file
std::vector< double > m_EtanlambdaEntry
external tanlambda parameter at entry point
int m_Eprimary
external flag for primary particles
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
int m_trackNumberSel
selected iterative number of the track in the run
std::vector< double > m_Etime
external time of the hit
std::vector< hitXP > m_hitXPSel
selected vector of hitXP
Class SVDTrueHit - Records of tracks that either enter or leave the sensitive volume.
TTree * m_treeTiSel
tight selected output tree
std::vector< double > m_EpositionEntryY
exteral position at entry point, coordinate y
Base class to provide Sensor Information for PXD and SVD.
int m_trackNumber
iterative number of the track in the run
This module from a data root file builds a tree of hitXP (see the class to know all the informations ...
std::vector< int > m_Ereconstructed
external flag of track-reconstruction or not
std::vector< double > m_EmomentumEntryY
exteral momentum at entry point, coordinate x
int m_eventNumberTiSel
tight selected interative number of the event in the run
int m_numberHitPerTrack
counter of the number of the hit for each track
std::vector< double > m_EmomentumEntryZ
exteral momentum at entry point, coordinate x
TTree * m_tree
full output tree
int m_eventNumber
interative number of the event in the run
int m_eventNumberSel
selected interative number of the event in the run
std::vector< double > m_Ephi00
external phi0 parameter at IP
std::vector< hitXP > m_hitXPTiSel
tight selected vector of hitXP
void terminate() override
This method is called at the end of the event processing.
This is the Reconstruction Event-Data Model Track.
std::vector< double > m_EomegaEntry
external omega parameter at entry point
int m_EnumberHitPerTrack
external numer of the hit for each track
int m_trackIterator
iterator used to count track (m_trackNumber)
std::vector< double > m_Eposition0Y
extral position at IP, coordinate y
std::set< hitXP, hitXP::timeCompare > m_hitXPSet
set of the hitXP, used to order tn time he hit
static GeoCache & getInstance()
Return a reference to the singleton instance.
Abstract base class for different kinds of events.
void beginRun() override
Called when entering a new run.
std::vector< double > m_Etanlambda0
external tanlambda parameter at IP
TTree * m_treeSel
selected output tree
std::vector< double > m_Eomega0
external omega parameter at IP
std::vector< int > m_EclusterU
external flag of u-cluster
std::vector< int > m_EsensorSensor
external sensor of the hit
int m_EeventNumber
external iterator of event in the run
TFile * m_outputFileTiSel
tight selected output file
std::vector< double > m_Echarge
external charge
int m_eventIterator
iterator used to count event number (m_eventNumber)
bool c_addTree
parameter to produce additional tree
std::vector< double > m_Emomentum0Y
extral momentum at IP, coordinate y
std::vector< double > m_EpositionLocalEntryZ
exteral local position at entry point, coordinate z
TFile * m_outputFileSel
selected output file
std::vector< double > m_Emomentum0Z
extral momentum at IP, coordinate z
std::vector< double > m_Eposition0Z
extral position at IP, coordinate z
TTree * m_treeExt
external output tree
std::vector< int > m_EsensorLadder
external ladder of the hit
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
std::vector< double > m_Ed0Entry
external d0 parameter at entry point
int m_EtrackNumber
external iterator of track in the run
std::vector< double > m_Ez00
external z0 parameter at IP
std::vector< int > m_EclusterV
external flag of v-cluster
std::vector< double > m_EpositionEntryZ
exteral position at entry point, coordinate z
int m_numberHitPerTrackTiSel
tight selected counter of the number of the hit for each track
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
A Class to store the Monte Carlo particle information.
This class is the derivate of HitXP, and complete it with a constructor that use all other complex ty...
std::vector< double > m_Ed00
external d0 parameter at IP
std::vector< int > m_EPDGID
external PDGID
std::vector< double > m_Emomentum0X
extral momentum at IP, coordinate x
int m_numberHitPerTrackSel
selected counter of the number of the hit for each track
std::vector< double > m_EmomentumEntryX
exteral momentum at entry point, coordinate x
std::vector< double > m_Eposition0X
extral position at IP, coordinate x
std::vector< int > m_EsensorLayer
external layer of the hit
void event() override
This method is the core of the module.