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 const auto bestSVDEvtT0 =
m_EventT0->getBestSVDTemporaryEventT0();
172 if (
m_EventT0->hasTemporaryEventT0(Const::EDetector::CDC)) {
173 const auto bestCDCEvtT0 =
m_EventT0->getBestCDCTemporaryEventT0();
178 if (
m_EventT0->hasTemporaryEventT0(Const::EDetector::TOP)) {
179 const auto bestTOPEvtT0 =
m_EventT0->getBestTOPTemporaryEventT0();
184 if (
m_EventT0->hasTemporaryEventT0(Const::EDetector::ECL)) {
185 const auto bestECLEvtT0 =
m_EventT0->getBestECLTemporaryEventT0();
192 for (
auto& evt : onlineEventT0) {
193 if (evt.getOnlineEventT0Detector() == Const::EDetector::SVD) {
194 B2DEBUG(40,
"OnlineEventT0 given by SVD");
199 if (evt.getOnlineEventT0Detector() == Const::EDetector::CDC) {
200 B2DEBUG(40,
"OnlineEventT0 given by CDC");
205 if (evt.getOnlineEventT0Detector() == Const::EDetector::ECL) {
206 B2DEBUG(40,
"OnlineEventT0 given by ECL");
211 if (evt.getOnlineEventT0Detector() == Const::EDetector::TOP) {
212 B2DEBUG(40,
"OnlineEventT0 given by TOP");
250 std::string m_svdEventInfoName =
"SVDEventInfo";
252 m_svdEventInfoName =
"SVDEventInfoSim";
254 if (!eventinfo) B2ERROR(
"No SVDEventInfo!");
255 m_svdTB = eventinfo->getModeByte().getTriggerBin();
262 for (
const auto& trk : recoTracks) {
263 if (! trk.wasFitSuccessful()) {
271 if (theTK.
size() == 0) {
278 const vector<SVDCluster* > svdClusters = trk.getSVDHitList();
279 B2DEBUG(40,
"FITTED TRACK: NUMBER OF SVD HITS = " << svdClusters.size());
281 for (
unsigned int i = 0; i < svdClusters.size(); i++) {
296 ROOT::Math::BoostZ boost(3. / 11);
297 pStar = boost(pStar);
336 if (isMC && trueHit_1.
size() > 0) {
341 if (mcParticle_1.
size() > 0) {
342 if (mcParticle_1[0]->isPrimaryParticle())
346 m_svdTrueTime.push_back(std::numeric_limits<float>::quiet_NaN());
351 for (
const auto& trgHit : TRGECLData) {
352 int hitWin = trgHit.getHitWin();
353 B2DEBUG(40,
"hitWin = " << hitWin);
354 if (hitWin != 3 && hitWin != 4) {
continue; }
371 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.