9#include <tracking/modules/trackingPerformanceEvaluation/HitXPModule.h>
10#include <framework/datastore/StoreArray.h>
11#include <framework/datastore/RelationArray.h>
12#include <mdst/dataobjects/MCParticle.h>
13#include <svd/dataobjects/SVDCluster.h>
14#include <svd/dataobjects/SVDTrueHit.h>
16#include <tracking/dataobjects/RecoTrack.h>
17#include <tracking/dataobjects/hitXPDerivate.h>
27 setDescription(
"This module builds a TTree with true hit information (momentum, position, PDGID, and track parameters hit per hit) running over simulated and reconstructed events.");
31 "produce two additional tree with reduced date: selTree (track with at least one hit per layer), tiSelTree (track with one hit per layer)",
37HitXPModule::~HitXPModule()
55 RelationArray relClusterTrueHits(storeClusters, storeTrueHits);
68 m_outputFile =
new TFile(
"TFile_hitXP.root",
"RECREATE");
69 m_tree =
new TTree(
"TTree_hitXP",
"TTree_hitXP");
83 m_treeSel =
new TTree(
"TTree_hitXPSel",
"TTree_hitXPSel");
95 m_treeTiSel =
new TTree(
"TTree_hitXPTiSel",
"TTree_hitXPTiSel");
109 m_treeExt =
new TTree(
"TTree_hitXP_ext",
"TTree_hitXP_ext");
164 if (hit.getRelationsFrom<
SVDCluster>().size() > 0) {
165 VxdID trueHitSensorID = hit.getSensorID();
172 if (Ncluster.isUCluster()) NClusterU++;
175 entry.setClusterU(NClusterU);
176 entry.setClusterV(NClusterV);
178 bool isReconstructed(
false);
180 isReconstructed |= aRecoTrack.hasSVDHits();
181 entry.setReconstructed(isReconstructed);
202 m_EPDGID.push_back(element.m_PDGID);
209 m_Etime.push_back(element.m_time);
218 m_Eomega0.push_back(element.getOmega0());
220 m_Ed00.push_back(element.getD00());
222 m_Ephi00.push_back(element.getPhi00());
224 m_Ez00.push_back(element.getZ00());
277 int f3 = 0, f4 = 0, f5 = 0, f6 = 0;
281 std::vector<hitXP> temp_hitXP;
282 while (j <
m_hitXP.size() && brk == 0) {
283 if (
m_hitXP[j].m_sensorLayer == 3) {
285 temp_hitXP.push_back(
m_hitXP[j]);
287 while (j <
m_hitXP.size() && brk == 0) {
288 if (
m_hitXP[j].m_sensorLayer == 4) {
290 temp_hitXP.push_back(
m_hitXP[j]);
292 while (j <
m_hitXP.size() && brk == 0) {
293 if (
m_hitXP[j].m_sensorLayer == 5) {
295 temp_hitXP.push_back(
m_hitXP[j]);
297 while (j <
m_hitXP.size() && brk == 0) {
298 if (
m_hitXP[j].m_sensorLayer == 6) {
300 temp_hitXP.push_back(
m_hitXP[j]);
315 layer_flag = f3 * f4 * f5 * f6;
316 if (layer_flag != 0) {
318 for (k = 0; k < 4; k = k + 1) {
335 &&
m_hitXP[2].m_sensorLayer == 5 &&
m_hitXP[3].m_sensorLayer == 6) {
337 for (h = 0; h < 4; h = h + 1) {
std::vector< double > m_EmomentumEntryX
external momentum at entry point, coordinate x
std::vector< int > m_EclusterV
external flag of v-cluster
TFile * m_outputFile
output file
std::vector< double > m_EomegaEntry
external omega parameter at entry point
std::vector< hitXP > m_hitXPSel
selected vector of hitXP
TTree * m_treeTiSel
tight selected output tree
TTree * m_tree
full output tree
std::vector< double > m_Etanlambda0
external tanlambda parameter at IP
std::vector< double > m_EtanlambdaEntry
external tanlambda parameter at entry point
TTree * m_treeExt
external output tree
std::vector< int > m_EPDGID
external PDGID
std::vector< int > m_EsensorLayer
external layer of the hit
int m_Eprimary
external flag for primary particles
std::vector< double > m_EmomentumEntryY
external momentum at entry point, coordinate x
void initialize() override
Initialize the Module.
int m_eventNumberTiSel
tight selected interative number of the event in the run
bool c_addTree
parameter to produce additional tree
void event() override
This method is the core of the module.
TFile * m_outputFileSel
selected output file
TTree * m_treeSel
selected output tree
std::vector< double > m_EpositionLocalEntryZ
external local position at entry point, coordinate z
std::vector< int > m_Ereconstructed
external flag of track-reconstruction or not
std::vector< double > m_EmomentumEntryZ
external momentum at entry point, coordinate x
std::vector< double > m_Etime
external time of the hit
void endRun() override
This method is called if the current run ends.
std::vector< double > m_Ephi0Entry
external phi0 parameter at entry point
std::vector< double > m_Ed00
external d0 parameter at IP
std::vector< int > m_EsensorSensor
external sensor of the hit
int m_trackNumberSel
selected iterative number of the track in the run
void terminate() override
This method is called at the end of the event processing.
std::vector< double > m_Emomentum0X
external momentum at IP, coordinate x
std::vector< double > m_Eposition0X
external position at IP, coordinate x
std::vector< double > m_EpositionLocalEntryY
external local position at entry point, coordinate y
int m_trackIterator
iterator used to count track (m_trackNumber)
std::vector< int > m_EsensorLadder
external ladder of the hit
std::vector< double > m_EpositionLocalEntryX
external local position at entry point, coordinate x
std::vector< double > m_Emomentum0Y
external momentum at IP, coordinate y
std::vector< int > m_EclusterU
external flag of u-cluster
int m_EeventNumber
external iterator of event in the run
std::vector< double > m_EpositionEntryX
external position at entry point, coordinate x
int m_numberHitPerTrackTiSel
tight selected counter of the number of the hit for each track
std::vector< hitXP > m_hitXPTiSel
tight selected vector of hitXP
int m_eventNumber
interative number of the event in the run
int m_numberHitPerTrack
counter of the number of the hit for each track
TFile * m_outputFileTiSel
tight selected output file
void beginRun() override
Called when entering a new run.
int m_trackNumber
iterative number of the track in the run
std::set< hitXP, hitXP::timeCompare > m_hitXPSet
set of the hitXP, used to order tn time he hit
TFile * m_outputFileExt
external output file
std::vector< double > m_EpositionEntryZ
external position at entry point, coordinate z
int m_eventNumberSel
selected interative number of the event in the run
std::vector< double > m_Emomentum0Z
external momentum at IP, coordinate z
int m_trackNumberTiSel
tight selected iterative number of the track in the run
std::vector< double > m_Ephi00
external phi0 parameter at IP
std::vector< double > m_Echarge
external charge
int m_numberHitPerTrackSel
selected counter of the number of the hit for each track
std::vector< hitXP > m_hitXP
vector of the hitXP, used to fill the output tree
int m_EtrackNumber
external iterator of track in the run
std::vector< double > m_EpositionEntryY
external position at entry point, coordinate y
int m_eventIterator
iterator used to count event number (m_eventNumber)
std::vector< double > m_Ed0Entry
external d0 parameter at entry point
StoreArray< MCParticle > m_MCParticles
MCParticles StoreArray.
std::vector< double > m_Ez00
external z0 parameter at IP
std::vector< double > m_Eomega0
external omega parameter at IP
std::vector< double > m_Eposition0Z
external position at IP, coordinate z
int m_EnumberHitPerTrack
external number of the hit for each track
std::vector< double > m_Eposition0Y
external position at IP, coordinate y
std::vector< double > m_Ez0Entry
external z0 parameter at entry point
A Class to store the Monte Carlo particle information.
void setDescription(const std::string &description)
Sets the description of the module.
This is the Reconstruction Event-Data Model Track.
Low-level class to create/modify relations between StoreArrays.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Class SVDTrueHit - Records of tracks that either enter or leave the sensitive volume.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Accessor to arrays stored in the data store.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
Base class to provide Sensor Information for PXD and SVD.
Class to uniquely identify a any structure of the PXD and SVD.
This class is the derivate of HitXP, and complete it with a constructor that use all other complex ty...
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.