10#include <klm/eklm/modules/EKLMAlignmentAlongStrips/EKLMAlignmentAlongStripsCollectorModule.h>
13#include <framework/gearbox/Unit.h>
14#include <tracking/dataobjects/ExtHit.h>
28 m_TransformData(nullptr),
31 setDescription(
"Module for EKLM alignment along strip (data collection).");
51 t =
new TTree(
"calibration_data",
"");
53 registerObject<TTree>(
"calibration_data", t);
61 const HepGeom::Transform3D* tr;
62 ROOT::Math::XYZVector hitPosition;
64 std::multimap<int, ExtHit*> mapExtHit;
65 std::multimap<int, ExtHit*>::iterator it, it2, itLower, itUpper;
66 std::set<int> digitVolumes;
68 TTree* calibrationData = getObjectPtr<TTree>(
"calibration_data");
71 for (i = 0; i < n; i++) {
74 for (j = 0; j < n2; j++) {
75 if (extHits[j]->getDetectorID() != Const::EDetector::EKLM)
79 mapExtHit.insert(std::pair<int, ExtHit*>(extHits[j]->getCopyID(),
85 for (i = 0; i < n; i++) {
92 digitVolumes.insert(vol);
95 for (it = mapExtHit.begin(); it != mapExtHit.end();) {
99 }
while ((it != mapExtHit.end()) && (it->first == itLower->first));
101 if (digitVolumes.find(itLower->first) != digitVolumes.end())
104 for (it2 = itLower; it2 != itUpper; ++it2) {
105 extHit = it2->second;
110 hitGlobal.setX(hitPosition.X() /
Unit::mm * CLHEP::mm);
111 hitGlobal.setY(hitPosition.Y() /
Unit::mm * CLHEP::mm);
112 hitGlobal.setZ(hitPosition.Z() /
Unit::mm * CLHEP::mm);
120 hitLocal = (*tr) * hitGlobal;
128 calibrationData->Fill();
Calibration collector module base class.
EKLM time calibration algorithm.
const EKLM::GeometryData * m_GeoDat
Geometry data.
EKLMAlignmentAlongStripsCollectorModule()
Constructor.
EKLM::TransformData * m_TransformData
Transformation data.
StoreArray< KLMDigit > m_KLMDigits
EKLM digits.
void collect() override
This method is called for each event.
const EKLMElementNumbers * m_ElementNumbers
Element numbers.
~EKLMAlignmentAlongStripsCollectorModule()
Destructor.
void prepare() override
Initializer.
void finish() override
This method is called at the end of the event processing.
StoreArray< Track > m_Tracks
Tracks.
struct EKLMAlignmentAlongStripsAlgorithm::Event * m_Event
Event.
int stripNumber(int section, int layer, int sector, int plane, int strip) const
Get strip number.
void stripNumberToElementNumbers(int stripGlobal, int *section, int *layer, int *sector, int *plane, int *strip) const
Get element numbers by strip global number.
static constexpr int getNStripsSegment()
Get number of strips in a segment.
int segmentNumber(int section, int layer, int sector, int plane, int segment) const
Get segment number.
bool hitInEKLM(double z) const
Check if z coordinate may be in EKLM.
static const GeometryData & Instance(enum DataSource dataSource=c_Database, const GearDir *gearDir=nullptr)
Instantiation.
double getStripLength(int strip) const
Get strip length.
Store one Ext hit as a ROOT object.
ROOT::Math::XYZVector getPosition() const
Get position of this extrapolation hit.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
Accessor to arrays stored in the data store.
static const double mm
[millimeters]
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.
float distFarEnd
Distance from hit to the far end of the strip.
int stripGlobal
Strip global number.
float distSiPM
Distance from hit to the SiPM.
int segmentGlobal
Segment global number.
int section
Section number.