10#include <klm/eklm/modules/EKLMAlignmentAlongStrips/EKLMAlignmentAlongStripsCollectorModule.h>
13#include <framework/gearbox/Unit.h>
14#include <tracking/dataobjects/ExtHit.h>
31 setDescription(
"Module for EKLM alignment along strip (data collection).");
51 t =
new TTree(
"calibration_data",
"");
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;
71 for (i = 0; i < n; i++) {
74 for (j = 0; j < n2; j++) {
75 if (extHits[j]->getDetectorID() != Const::EDetector::EKLM)
77 if (!
m_GeoDat->hitInEKLM(extHits[j]->getPosition().Z()))
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);
113 m_Event->stripGlobal = it2->first;
120 hitLocal = (*tr) * hitGlobal;
128 calibrationData->Fill();
void registerObject(std::string name, T *obj)
Register object with a name, takes ownership, do not access the pointer beyond prepare()
CalibrationCollectorModule()
Constructor. Sets the default prefix for calibration dataobjects.
T * getObjectPtr(std::string name)
Calls the CalibObjManager to get the requested stored collector data.
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.
static const GeometryData & Instance(enum DataSource dataSource=c_Database, const GearDir *gearDir=nullptr)
Instantiation.
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.