11static const int LAYERS_IDENTICAL = 0x01;
12static const int MODULES_MASK = 0xFF00;
13static const int INPLANE_IDENTICAL = 0x0100;
17 : ConditionsObject(CONDITIONS_OBJECT_NAME),
19 ecalGeometry_{ecalGeom} {
20 if ((
symmetry_ & MODULES_MASK) == INPLANE_IDENTICAL) {
24 for (
int v = 1; v <= 10; v += 3) {
25 for (
int u = 1; u <= 10; u += 3) {
27 std::vector<ldmx::EcalID> pids;
28 for (
int du = -1; du <= 1; du++) {
29 for (
int dv = -1; dv <= 1; dv++) {
40 for (
int v = 13; v <= 22; v += 3) {
41 for (
int u = v - 10; u <= v; u += 3) {
43 std::vector<ldmx::EcalID> pids;
44 for (
int dv = -1; dv <= 1; dv++) {
45 for (
int du = -1; du <= 1; du++) {
57 for (
int v = 2; v <= 22; v += 3) {
58 int irow = (v - 2) / 3;
59 for (
int icol = 0; icol <= std::min(irow, 3); icol++) {
60 if (irow - icol >= 4)
continue;
62 std::vector<ldmx::EcalID> pids;
63 int u = 13 + 3 * icol;
64 for (
int dv = -1; dv <= 1; dv++) {
65 for (
int du = -1; du <= 1; du++) {
84 std::vector<ldmx::EcalID> retval;
85 if ((
symmetry_ & MODULES_MASK) == INPLANE_IDENTICAL) {
90 for (
auto idz : ptr->second) {
101 if ((
symmetry_ & MODULES_MASK) == INPLANE_IDENTICAL) {
106 std::stringstream ss;
107 ss <<
"Unable to find trigger cell " << triggerCell;
108 EXCEPTION_RAISE(
"EcalGeometryException", ss.str());
112 ptr->second[4].cell());
118 if ((
symmetry_ & MODULES_MASK) == INPLANE_IDENTICAL) {
126 ptr->second.triggercell());
151 const std::string& tagname,
156 ecalTriggerGeometry_{nullptr} {}
160 if (ecalTriggerGeometry_ !=
nullptr)
delete ecalTriggerGeometry_;
161 ecalTriggerGeometry_ =
nullptr;
173 if (ecalTriggerGeometry_ ==
nullptr) {
174 std::pair<const framework::ConditionsObject*, framework::ConditionsIOV>
176 ldmx::EcalGeometry::CONDITIONS_OBJECT_NAME, context);
180 INPLANE_IDENTICAL | LAYERS_IDENTICAL, ecalgeom);
182 return std::make_pair(ecalTriggerGeometry_,
Base class for provider of conditions information like pedestals, gains, electronics maps,...
#define DECLARE_CONDITIONS_PROVIDER_NS(NS, CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Class that translates raw positions of ECal module hits into cells in a hexagonal readout.
Class that defines the relationship between precision cells and trigger cells and provides geometry i...
be configured to load conditions objects from CSV files.
EcalTriggerGeometryProvider(const std::string &name, const std::string &tagname, const framework::config::Parameters ¶meters, framework::Process &process)
Class constructor.
virtual ~EcalTriggerGeometryProvider()
Destructor.
virtual std::pair< const framework::ConditionsObject *, framework::ConditionsIOV > getCondition(const ldmx::EventHeader &context)
Provides access to the EcalGeometry or EcalTriggerGeometry.
virtual void releaseConditionsObject(const framework::ConditionsObject *co)
Take no action on release, as the object is permanently owned by the Provider.
defines the relationship between precision cells and trigger cells and provides geometry information ...
std::vector< ldmx::EcalID > contentsOfTriggerCell(ldmx::EcalTriggerID triggerCell) const
Returns the set of precision (full-granularity/DAQ) cells which are associated with the given trigger...
const ldmx::EcalGeometry * ecalGeometry_
Reference to the Ecal geometry used for trigger geometry information.
std::pair< double, double > localPosition(ldmx::EcalTriggerID triggerCell) const
Returns the local (within module) center of the given trigger cell.
int symmetry_
Identifies what symmetries apply in this case, such as all layers being identical,...
EcalTriggerGeometry(int symmetry, const ldmx::EcalGeometry *ecalGeom=0)
std::map< ldmx::EcalTriggerID, std::vector< ldmx::EcalID > > trigger2precision_
Map of trigger cells to precision cells, under symmetry assumptions.
ldmx::EcalTriggerID belongsTo(ldmx::EcalID precisionCell) const
Returns which trigger cell this precision cell is associated with, or a null id if there is no such a...
std::map< ldmx::EcalID, ldmx::EcalTriggerID > precision2trigger_
Map of precision cells to trigger cells, under symmetry assumptions.
std::tuple< double, double, double > globalPosition(ldmx::EcalTriggerID triggerCell) const
Returns the center of the given trigger cell in world coordinates.
ldmx::EcalID centerInTriggerCell(ldmx::EcalTriggerID triggerCell) const
Returns the set of precision (full-granularity/DAQ) cell which is the center of the given trigger cel...
Class which defines the run/event/type range for which a given condition is valid,...
Base class for all providers of conditions objects.
std::pair< const ConditionsObject *, ConditionsIOV > requestParentCondition(const std::string &name, const ldmx::EventHeader &context)
Request another condition needed to construct this condition.
const Process & process() const
Get the process handle.
Base class for all conditions objects, very simple.
Class which represents the process under execution.
Class encapsulating parameters for configuring a processor.
Translation between real-space positions and cell IDs within the ECal.
std::tuple< double, double, double > getPosition(EcalID id) const
Get a cell's position from its ID number.
std::pair< double, double > getPositionInModule(int cell_id) const
Get a cell's position within a module.
Extension of DetectorID providing access to ECal layers and cell numbers in a hex grid.
int cell() const
Get the value of the cell field from the ID.
int module() const
Get the value of the module field from the ID.
int layer() const
Get the value of the layer field from the ID.
Extension of DetectorID providing access to ECal trigger cell information.
int layer() const
Get the value of the layer field from the ID.
int module() const
Get the value of the module field from the ID.
int triggercell() const
Get the value of the trigger cell field from the ID.