34 std::vector<geo::CryostatGeo>
const& cgeo = geodata.
cryostats;
38 mf::LogInfo(
"ChannelMapCRMAlg") <<
"Initializing CRM ChannelMap...";
70 for(
unsigned int TPCCount = 0; TPCCount !=
fNTPC[
cs]; ++TPCCount)
72 unsigned int PlanesThisTPC = cgeo[
cs].TPC(TPCCount).Nplanes();
79 for(
unsigned int PlaneCount = 0; PlaneCount != PlanesThisTPC; ++PlaneCount){
82 throw cet::exception(
"Geometry") <<
"CANNOT HAVE more than two readout planes for dual-phase" 99 double ThisWirePitch = cgeo[
cs].TPC(TPCCount).WirePitch(PlaneCount);
100 fWireCounts[
cs][TPCCount][PlaneCount] = cgeo[
cs].TPC(TPCCount).Plane(PlaneCount).Nwires();
102 double WireCentre1[3] = {0.,0.,0.};
103 double WireCentre2[3] = {0.,0.,0.};
105 const geo::WireGeo& firstWire = cgeo[
cs].TPC(TPCCount).Plane(PlaneCount).Wire(0);
109 cgeo[
cs].TPC(TPCCount).Plane(PlaneCount).Wire(1).GetCenter(WireCentre2,0);
113 double OrthY = cth, OrthZ = -sth;
114 if(((WireCentre2[1] - WireCentre1[1])*OrthY
115 + (WireCentre2[2] - WireCentre1[2])*OrthZ) < 0){
129 fFirstWireProj[
cs][TPCCount][PlaneCount] = WireCentre1[1]*OrthY + WireCentre1[2]*OrthZ;
133 int WiresThisPlane = cgeo[
cs].TPC(TPCCount).Plane(PlaneCount).Nwires();
137 RunningTotal += WiresThisPlane;
164 std::vector< geo::WireID > AllSegments;
165 unsigned int cstat = 0;
166 unsigned int tpc = 0;
167 unsigned int plane = 0;
168 unsigned int wire = 0;
172 throw cet::exception(
"Geometry") <<
"ILLEGAL CHANNEL ID for channel " << channel <<
"\n";
175 bool foundWid(
false);
176 for(
unsigned int csloop = 0; csloop !=
fNcryostat; ++csloop){
177 for(
unsigned int tpcloop = 0; tpcloop !=
fNTPC[csloop]; ++tpcloop){
178 for(
unsigned int planeloop = 0;
199 AllSegments.push_back(CodeWire);
212 if (!
HasROP(ropid))
return 0;
240 int NearestWireNumber =
int 246 if(NearestWireNumber < 0 ||
247 (
unsigned int) NearestWireNumber >=
WireCount(planeID))
249 int wireNumber = NearestWireNumber;
251 if(NearestWireNumber < 0 ) NearestWireNumber = 0;
252 else NearestWireNumber =
WireCount(planeID) - 1;
255 <<
"Can't Find Nearest Wire for position (" 256 << worldPos[0] <<
"," << worldPos[1] <<
"," << worldPos[2] <<
")" 257 <<
" in plane " <<
std::string(planeID) <<
" approx wire number # " 258 << wireNumber <<
" (capped from " << NearestWireNumber <<
")\n";
285 return *pBaseLine + wireID.
Wire;
294 mf::LogWarning(
"ChannelMapCRMAlg") <<
"should not be at the point in the function, returning " 295 <<
"invalid channel";
308 unsigned int tpc = channel / nChanPerTPC;
310 unsigned int PlanesThisTPC =
fNPlanes[0][tpc];
320 <<
" not given signal type." <<
std::endl;
414 std::vector<geo::TPCID> IDs;
432 unsigned int max = 0;
433 for (
unsigned int nTPCs:
fNTPC)
if (nTPCs > max) max = nTPCs;
456 unsigned int max = 0;
457 for (
auto const& cryo_tpc:
fNPlanes)
458 for (
unsigned int nPlanes: cryo_tpc)
459 if (nPlanes > max) max = nPlanes;
486 std::vector<geo::PlaneID> IDs;
515 std::vector<geo::TPCID> IDs;
533 if (wires.empty())
return {};
576 if (!tpcsetid.
isValid)
return {};
588 if (!planeid.
isValid)
return {};
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
virtual std::vector< geo::PlaneID > ROPtoWirePlanes(readout::ROPID const &ropid) const override
Returns a list of ID of planes belonging to the specified ROP.
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const override
Returns the total number of TPC sets in the specified cryostat.
Encapsulate the construction of a single cyostat.
virtual SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const override
Return the signal type of the specified channel.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
unsigned int ROPID_t
Type for the ID number.
unsigned short TPCsetID_t
Type for the ID number.
unsigned int PlaneID_t
Type for the ID number.
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const override
Returns the total number of ROP in the specified TPC set.
The data type to uniquely identify a Plane.
bool isValid
Whether this ID points to a valid element.
PlaneInfoMap_t< unsigned int > fPlaneBaselines
virtual readout::TPCsetID TPCtoTPCset(geo::TPCID const &tpcid) const override
Returns the ID of the TPC set tpcid belongs to.
Class identifying a set of TPC sharing readout channels.
CryostatID_t Cryostat
Index of cryostat.
virtual geo::TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const override
Returns the ID of the first TPC belonging to the specified TPC set.
PlaneInfoMap_t< float > fOrthVectorsY
Unit vectors orthogonal to wires in.
virtual geo::PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const override
Returns the ID of the first plane belonging to the specified ROP.
WireID_t Wire
Index of the wire within its plane.
T const & AccessElement(TPCInfoMap_t< T > const &map, geo::TPCID const &id) const
Returns the specified element of the TPC map.
CryostatList_t cryostats
The detector cryostats.
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const override
virtual raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const override
Returns the ID of the first channel in the specified readout plane.
unsigned int MaxTPCs() const
Returns the largest number of TPCs in a single cryostat.
void Initialize(GeometryData_t const &geodata) override
Geometry initialisation.
virtual std::set< PlaneID > const & PlaneIDs() const override
Returns a list of the plane IDs in the whole detector.
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
ROPID_t ROP
Index of the readout plane within its TPC set.
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
Collection of exceptions for Geometry system.
enum geo::_plane_sigtype SigType_t
virtual unsigned int MaxROPs() const override
Returns the largest number of ROPs a TPC set in the detector has.
unsigned int fNchannels
number of channels in the detector
constexpr bool isValidChannelID(raw::ChannelID_t channel)
Encapsulate the geometry of an auxiliary detector.
std::vector< unsigned int > fNTPC
number of TPCs in each cryostat
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const override
static geo::PlaneID ConvertROPtoWirePlane(readout::ROPID const &ropid)
Converts a wire plane ID into a ROP ID using the same numerical indices.
Interface to algorithm class for a dual-phase detector channel mapping.
static readout::TPCsetID ConvertTPCtoTPCset(geo::TPCID const &tpcid)
Converts a TPC ID into a TPC set ID using the same numerical indices.
static int max(int a, int b)
The data type to uniquely identify a TPC.
PlaneID_t Plane
Index of the plane within its TPC.
virtual unsigned int MaxTPCsets() const override
Returns the largest number of TPC sets any cryostat in the detector has.
Class identifying a set of planes sharing readout channels.
raw::ChannelID_t fTopChannel
book keeping highest channel #
PlaneInfoMap_t< unsigned int > fWiresPerPlane
unsigned int fNcryostat
number of cryostats in the detector
TPCsetID_t TPCset
Index of the TPC set within its cryostat.
PlaneInfoMap_t< float > fOrthVectorsZ
Encapsulate the geometry of a wire.
unsigned int WireCount(geo::PlaneID const &id) const
Retrieved the wire cound for the specified plane ID.
virtual raw::ChannelID_t PlaneWireToChannel(geo::WireID const &wireID) const override
Returns the channel ID a wire is connected to.
virtual readout::ROPID ChannelToROP(raw::ChannelID_t channel) const override
T const * GetElementPtr(PlaneInfoMap_t< T > const &map, geo::PlaneID const &id) const
Returns a pointer to the specified element, or nullptr if invalid.
unsigned int CryostatID_t
Type for the ID number.
static readout::ROPID ConvertWirePlaneToROP(geo::PlaneID const &planeid)
Converts a ROP ID into a wire plane ID using the same numerical indices.
unsigned int TPCID_t
Type for the ID number.
Encapsulate the construction of a single detector plane.
std::set< PlaneID > fPlaneIDs
vector of the PlaneIDs present in the detector
void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()
virtual double WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeID) const override
Returns the index of the wire nearest to the specified position.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
ChannelMapCRMAlg(fhicl::ParameterSet const &p)
TPCInfoMap_t< unsigned int > fNPlanes
virtual bool HasROP(readout::ROPID const &ropid) const override
static geo::TPCID ConvertTPCsetToTPC(readout::TPCsetID const &tpcsetid)
Converts a TPC set ID into a TPC ID using the same numerical indices.
unsigned int Nchannels() const override
Returns the total number of channels present (not necessarily contiguous)
unsigned int WireID_t
Type for the ID number.
Access the description of detector geometry.
detail::Node< FrameID, bool > PlaneID
virtual std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const override
Returns a list of ID of TPCs the specified ROP spans.
Exception thrown on invalid wire number (e.g. NearestWireID())
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
Data in the geometry description.
double CosThetaZ() const
Returns trigonometric operations on ThetaZ()
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextPlane
unsigned int ChannelID_t
Type representing the ID of a readout channel.
TPCID_t TPC
Index of the TPC within its cryostat.
PlaneInfoMap_t< float > fWireCounts
PlaneInfoMap_t< float > fFirstWireProj
virtual readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const override
Returns the ID of the ROP planeid belongs to.
LArSoft geometry interface.
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
constexpr TPCsetID const & asTPCsetID() const
Conversion to TPCsetID (for convenience of notation).
Encapsulate the construction of a single detector plane.
The data type to uniquely identify a cryostat.
virtual WireID NearestWireID(const TVector3 &worldPos, geo::PlaneID const &planeID) const override
Returns the ID of the wire nearest to the specified position.
Signal from collection planes.
virtual std::vector< geo::TPCID > TPCsetToTPCs(readout::TPCsetID const &tpcsetid) const override
Returns a list of ID of TPCs belonging to the specified TPC set.