9 #include <svd/modules/svdPerformance/SVDEventT0PerformanceTTreeModule.h>
10 #include <framework/gearbox/Unit.h>
11 #include <framework/core/Environment.h>
12 #include <framework/dataobjects/EventMetaData.h>
13 #include <svd/dataobjects/SVDShaperDigit.h>
14 #include <svd/dataobjects/SVDTrueHit.h>
15 #include <svd/dataobjects/SVDEventInfo.h>
16 #include <vxd/dataobjects/VxdID.h>
17 #include <vxd/geometry/SensorInfoBase.h>
18 #include <tracking/dataobjects/RecoTrack.h>
19 #include <tracking/dataobjects/RecoHitInformation.h>
20 #include <genfit/TrackPoint.h>
22 #include <TDirectory.h>
23 #include <Math/Boost.h>
27 #include <mdst/dataobjects/Track.h>
28 #include <mdst/dataobjects/TrackFitResult.h>
29 #include <mdst/dataobjects/MCParticle.h>
30 #include <framework/datastore/RelationArray.h>
33 #include <trg/ecl/dataobjects/TRGECLUnpackerStore.h>
36 #include <hlt/dataobjects/OnlineEventT0.h>
54 setDescription(
"This module is used to create a TTree to study SVD eventT0 using clusters associated to tracks.");
56 addParam(
"outputFileName",
m_rootFileName,
"Name of output root file.", std::string(
"SVDEventT0PerformanceTTree.root"));
68 TDirectory::TContext context;
74 m_t =
new TTree(
"tree",
"Tree for SVD clusters related to tracks");
135 m_eventT0 = std::numeric_limits<float>::quiet_NaN();
153 m_eclTCEmax = std::numeric_limits<int>::quiet_NaN();
154 m_eclTCid = std::numeric_limits<int>::quiet_NaN();
157 m_exp = evtMetaData->getExperiment();
158 m_run = evtMetaData->getRun();
159 m_event = evtMetaData->getEvent();
166 if (
m_EventT0->hasTemporaryEventT0(Const::EDetector::SVD)) {
167 auto evtT0List_SVD =
m_EventT0->getTemporaryEventT0s(Const::EDetector::SVD) ;
173 if (
m_EventT0->hasTemporaryEventT0(Const::EDetector::CDC)) {
174 auto evtT0List_CDC =
m_EventT0->getTemporaryEventT0s(Const::EDetector::CDC) ;
180 if (
m_EventT0->hasTemporaryEventT0(Const::EDetector::TOP)) {
181 auto evtT0List_TOP =
m_EventT0->getTemporaryEventT0s(Const::EDetector::TOP) ;
187 if (
m_EventT0->hasTemporaryEventT0(Const::EDetector::ECL)) {
188 auto evtT0List_ECL =
m_EventT0->getTemporaryEventT0s(Const::EDetector::ECL) ;
196 for (
auto& evt : onlineEventT0) {
197 if (evt.getOnlineEventT0Detector() == Const::EDetector::SVD) {
198 B2DEBUG(40,
"OnlineEventT0 given by SVD");
203 if (evt.getOnlineEventT0Detector() == Const::EDetector::CDC) {
204 B2DEBUG(40,
"OnlineEventT0 given by CDC");
209 if (evt.getOnlineEventT0Detector() == Const::EDetector::ECL) {
210 B2DEBUG(40,
"OnlineEventT0 given by ECL");
215 if (evt.getOnlineEventT0Detector() == Const::EDetector::TOP) {
216 B2DEBUG(40,
"OnlineEventT0 given by TOP");
254 std::string m_svdEventInfoName =
"SVDEventInfo";
256 m_svdEventInfoName =
"SVDEventInfoSim";
258 if (!eventinfo) B2ERROR(
"No SVDEventInfo!");
259 m_svdTB = eventinfo->getModeByte().getTriggerBin();
266 for (
const auto& trk : recoTracks) {
267 if (! trk.wasFitSuccessful()) {
275 if (theTK.
size() == 0) {
282 const vector<SVDCluster* > svdClusters = trk.getSVDHitList();
283 B2DEBUG(40,
"FITTED TRACK: NUMBER OF SVD HITS = " << svdClusters.size());
285 for (
unsigned int i = 0; i < svdClusters.size(); i++) {
300 ROOT::Math::BoostZ boost(3. / 11);
301 pStar = boost(pStar);
340 if (isMC && trueHit_1.
size() > 0) {
345 if (mcParticle_1.
size() > 0) {
346 if (mcParticle_1[0]->isPrimaryParticle())
350 m_svdTrueTime.push_back(std::numeric_limits<float>::quiet_NaN());
355 for (
const auto& trgHit : TRGECLData) {
356 int hitWin = trgHit.getHitWin();
357 B2DEBUG(40,
"hitWin = " << hitWin);
358 if (hitWin != 3 && hitWin != 4) {
continue; }
375 TDirectory::TContext context;
static const ChargedStable pion
charged pion particle
bool isMC() const
Do we have generated, not real data?
static Environment & Instance()
Static method to get a reference to the Environment instance.
A Class to store the Monte Carlo particle information.
void setDescription(const std::string &description)
Sets the description of the module.
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
float getClsTime() const
Get average of waveform maximum times of cluster strip signals.
float getSNR() const
Get cluster SNR.
unsigned short getSize() const
Get cluster size.
float getCharge() const
Get collected charge.
VxdID getSensorID() const
Get the sensor ID.
bool isUCluster() const
Get the direction of strips.
float getPosition(double v=0) const
Get the coordinate of reconstructed hit.
float getClsTimeSigma() const
Get the error of the reconstructed hit time.
float getPositionSigma() const
Get the error of the reconstructed hit coordinate.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
int getEntries() const
Get the number of objects in the array.
Type-safe access to single objects in the data store.
bool isValid() const
Check whether the object was created.
Values of the result of a track fit with a given particle hypothesis.
float getNDF() const
Getter for number of degrees of freedom of the track fit.
short getChargeSign() const
Return track charge (1 or -1).
double getPValue() const
Getter for Chi2 Probability of the track fit.
ROOT::Math::PxPyPzEVector get4Momentum() const
Getter for the 4Momentum at the closest approach of the track in the r/phi projection.
double getD0() const
Getter for d0.
double getZ0() const
Getter for z0.
ROOT::Math::XYZVector getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.
Class to uniquely identify a any structure of the PXD and SVD.
baseType getSensorNumber() const
Get the sensor id.
baseType getLadderNumber() const
Get the ladder id.
baseType getLayerNumber() const
Get the layer id.
REG_MODULE(arichBtest)
Register the Module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Abstract base class for different kinds of events.