9#include <tracking/trackFindingVXD/sectorMapTools/NoKickRTSel.h>
10#include <tracking/trackFindingVXD/sectorMapTools/NoKickCuts.h>
12#include <tracking/dataobjects/hitXPDerivate.h>
14#include <mdst/dataobjects/MCParticle.h>
15#include <pxd/dataobjects/PXDTrueHit.h>
16#include <svd/dataobjects/SVDTrueHit.h>
28 if (track.getRelationsTo<
MCParticle>().size() > 0) {
32 std::vector<Belle2::RecoHitInformation::UsedSVDHit*> clusterListSVD = track.getSVDHitList();
33 for (
const SVDCluster* cluster : clusterListSVD) {
36 if (hitFromParticle.
size() > 0) {
37 if (hitFromParticle[0]->getIndex() != particle->getIndex()) {
41 VxdID trueHitSensorID = hit.getSensorID();
47 if (Ncluster.isUCluster()) NClusterU++;
53 bool isReconstructed(
false);
55 isReconstructed |= aRecoTrack.hasSVDHits();
66 std::vector<Belle2::RecoHitInformation::UsedPXDHit*> clusterListPXD = track.getPXDHitList();
67 for (
const PXDCluster* cluster : clusterListPXD) {
70 if (hitFromParticle.
size() > 0) {
71 if (hitFromParticle[0]->getIndex() != particle->getIndex()) {
75 VxdID trueHitSensorID = hit.getSensorID();
79 bool isReconstructed(
false);
81 isReconstructed |= aRecoTrack.hasPXDHits();
102 }
else if (XP.m_sensorLayer !=
m_8hitTrack.back().m_sensorLayer ||
103 XP.m_sensorLadder !=
m_8hitTrack.back().m_sensorLadder ||
104 XP.m_sensorSensor !=
m_8hitTrack.back().m_sensorSensor) {
119 for (
const hitXP& XP : track8) {
120 if (XP.getSensorLayer() == 3) lay3 = 1;
121 if (XP.getSensorLayer() == 4) lay4 = 1;
122 if (XP.getSensorLayer() == 5) lay5 = 1;
123 if (XP.getSensorLayer() == 6) lay6 = 1;
127 int N_lay = lay3 + lay4 + lay5 + lay6;
128 if (N_lay >= 3) N_lay = 1;
130 int flagTot = flagd0 * flagz0 * N_lay;
131 if (flagTot == 1)
return true;
142 case NoKickCuts::c_Omega:
148 case NoKickCuts::c_D0:
154 case NoKickCuts::c_Phi0:
160 case NoKickCuts::c_Z0:
166 case NoKickCuts::c_Tanlambda:
174 if (fabs(selCut.at(0)) > fabs(selCut.at(1))) {
175 usedCut = fabs(selCut.at(0));
176 }
else usedCut = fabs(selCut.at(1));
178 if (deltaPar > -usedCut && deltaPar < usedCut)
return true;
180 B2DEBUG(20,
"--------------------------");
183 B2DEBUG(20,
"parameter=" << par);
184 B2DEBUG(20,
"Min=" << selCut.at(0));
185 B2DEBUG(20,
"Max=" << selCut.at(1));
186 B2DEBUG(20,
"deltaPar=" << deltaPar);
202 m_pMag = track.getMomentumSeed().R();
203 m_pt =
sqrt(track.getMomentumSeed().X() * track.getMomentumSeed().X() + track.getMomentumSeed().Y() * track.getMomentumSeed().Y());
213 m_momCut->Fill(track.getMomentumSeed().R());
220 if (track.getMomentumSeed().R() >
m_pmax) {
225 m_momSel->Fill(track.getMomentumSeed().R());
231 for (
int i = 0; i < (int)(
m_8hitTrack.size() - 2); i++) {
232 double sinTheta = fabs(
m_8hitTrack.at(i).m_momentum0.Y()) /
241 for (
int j = NoKickCuts::c_Omega; j <= NoKickCuts::c_Tanlambda; j++) {
265 m_momSel->Fill(track.getMomentumSeed().R());
269 m_momCut->Fill(track.getMomentumSeed().R());
A Class to store the Monte Carlo particle information.
int getPDG() const
Return PDG code of particle.
EParameters
enum for parameters name
TFile * m_noKickOutputTFile
validation output TFile
int m_numberOfCuts
number of catastrophic interaction for each track
NoKickCuts m_trackCuts
auxiliary member to apply the cuts
double m_pmax
range analyzed with cuts
std::vector< hitXP > m_8hitTrack
vector of selected hit
int m_Ncuts
number of times the cut is applied on a particle
TH1F * m_momEff
histogram for efficiency
void hitXPBuilder(const RecoTrack &track)
this method build a vector of hitXP from a track.
bool segmentSelector(const hitXP &hit1, const hitXP &hit2, const std::vector< double > &selCut, NoKickCuts::EParameters par, bool is0=false)
This method return true if a couple of hits resects the cuts constraints.
TTree * m_noKickTree
TTree to which the information is written.
void initNoKickRTSel()
Initialize the class cleaning the member vectors.
TH1F * m_PDGIDCut
histogram for PDGID of cut track
TH1F * m_PDGIDSel
histogram for PDGID of selected track
bool globalCut(const std::vector< hitXP > &track8)
This method make some global cuts on the tracks (layer 3 and 6 required, d0 and z0 inside beam pipe).
double m_pMag
momentum magnitut
TH1F * m_PDGIDEff
histogram for efficiency for each PDGID
TH1F * m_momCut
histogram of cut tracks
std::set< hitXP, hitXP::timeCompare > m_setHitXP
set of hit to order the hit in time
bool trackSelector(const RecoTrack &track)
This method return true if every segment (see segmentSelector) of the input track respects the cuts c...
void produceHistoNoKick()
This method produce the validation histograms (to be used the endrun combined with the filling in tra...
bool m_isCutted
Indicator if cut is applied.
bool m_outputFlag
true=produce validation output
TH1F * m_nCutHit
histogram for number of cut hist per track
std::vector< hitXP > m_hitXP
vector of hit, to convert the track
TH1F * m_momSel
histogram of selected tracks
void hit8TrackBuilder(const RecoTrack &track)
this method build a vector of hitXP from a track selecting the first hit on each layer of VXD (8 hit ...
double m_pt
transverse momentum
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
Class PXDTrueHit - Records of tracks that either enter or leave the sensitive volume.
This is the Reconstruction Event-Data Model Track.
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
RelationVector< FROM > getRelationsFrom(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from another store array to this object.
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.
Accessor to arrays stored in the data store.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a reference 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...
This class collects some information of a TrueHit, using SVDCLuster and MCParticle information too.
double getOmegaEntry() const
evaluate relative parameter using entrypoint position and momentum
double getPhi00() const
evaluate relative parameter using IP position and momentum
double getZ0Entry() const
evaluate relative parameter using entrypoint position and momentum
void setClusterU(int cluster)
get the relative member
double getOmega0() const
evaluate relative parameter using IP position and momentum
int m_sensorLayer
layer of the hit
double getD00() const
evaluate relative parameter using IP position and momentum
void setReconstructed(bool isReconstructed)
get the relative member
void setClusterV(int cluster)
get the relative member
double getPhi0Entry() const
evaluate relative parameter using entrypoint position and momentum
double getZ00() const
evaluate relative parameter using IP position and momentum
double getTanLambda0() const
evaluate relative parameter using IP position and momentum
double getD0Entry() const
evaluate relative parameter using entrypoint position and momentum
double getTanLambdaEntry() const
evaluate relative parameter using entrypoint position and momentum
ROOT::Math::XYZVector m_momentum0
momentum at IP
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.