35 std::vector<geo::CryostatGeo>
const& cgeo = geodata.
cryostats;
39 mf::LogInfo(
"ChannelMapAPAAlg") <<
"Initializing channel map...";
70 double xyz_next[3] = {0.};
82 cgeo[0].TPC(0).Plane(
p).Wire(
w).GetCenter(xyz);
83 cgeo[0].TPC(0).Plane(
p).Wire(
w+1).GetCenter(xyz_next);
85 if(xyz[2]==xyz_next[2]){
96 for(
unsigned int PCount = 0; PCount !=
fPlanesPerAPA; ++PCount){
116 for (
unsigned int tpc=0; tpc<cgeo[
cs].NTPC(); ++tpc){
118 for (
unsigned int plane=0; plane<cgeo[
cs].TPC(tpc).Nplanes(); ++plane){
136 PlaneData.
fYmax = endpoint[1];
137 PlaneData.
fYmin = endpoint[1];
138 PlaneData.
fZmax = endpoint[2];
139 PlaneData.
fZmin = endpoint[2];
141 for (
unsigned int iwire=0;iwire<
nwires;iwire++){
164 for (
unsigned int plane=0; plane<cgeo[0].TPC(0).Nplanes(); plane++){
165 fWirePitch[plane]=cgeo[0].TPC(0).WirePitch(plane);
166 fOrientation[plane]=cgeo[0].TPC(0).Plane(plane).Wire(0).ThetaZ();
210 throw cet::exception(
"Geometry") <<
"ILLEGAL CHANNEL ID for channel " << channel <<
"\n";
212 std::vector< WireID > AllSegments;
214 static unsigned int cstat;
215 static unsigned int tpc;
216 static unsigned int plane;
217 static unsigned int wireThisPlane;
218 static unsigned int NextPlane;
219 static unsigned int ThisPlane;
224 bool breakVariable =
false;
225 for(
unsigned int planeloop = 0; planeloop !=
fPlanesPerAPA; ++planeloop){
230 if(chan < NextPlane){
234 tpc = (2*pureAPAnum) %
fNTPC[0];
236 wireThisPlane = chan - ThisPlane;
238 breakVariable =
true;
241 if(breakVariable)
break;
246 int WrapDirection = 1;
250 unsigned int bottomwire = wireThisPlane-ChannelGroup*
nAnchoredWires[plane];
252 if(ChannelGroup%2==1){
257 for(
unsigned int SegCount = 0; SegCount != 50; ++SegCount){
259 tpc += WrapDirection*(SegCount%2);
260 geo::WireID CodeWire(cstat, tpc, plane, bottomwire + SegCount*nAnchoredWires[plane]);
261 AllSegments.push_back(CodeWire);
264 tpc -= WrapDirection*(SegCount%2);
266 if( bottomwire + (SegCount+1)*nAnchoredWires[plane] >
fWiresInPlane[plane]-1)
break;
284 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
307 const bool bSuppl = (planeid.
TPC % 2) == 1;
335 int NearestWireNumber
341 if(NearestWireNumber < 0 ||
344 const int wireNumber = NearestWireNumber;
346 if(wireNumber < 0 ) NearestWireNumber = 0;
347 else NearestWireNumber = fWiresInPlane[planeid.
Plane] - 1;
367 unsigned int OtherSideWires = 0;
401 else{
mf::LogWarning(
"BadChannelSignalType") <<
"Channel " << channel
402 <<
" (" << chan <<
") not given signal type." <<
std::endl; }
421 else{
mf::LogWarning(
"BadChannelViewType") <<
"Channel " << channel
422 <<
" (" << chan <<
") not given view type."; }
455 return uniqueChannel;
476 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
483 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
498 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
506 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
514 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
522 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
528 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
542 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
550 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
558 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
566 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
574 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
582 throw cet::exception(
"ChannelMapAPAAlg") << __func__ <<
" not implemented!\n";
unsigned int fNchannels
number of channels in the detector
float fWireSortingInZ
+1 if the wire ID order follow z (larger z, or smaller intercept => larger wire ID); -1 otherwise ...
std::set< View_t > fViews
vector of the views present in the detector
void GetStart(double *xyz) const
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
std::vector< unsigned int > fWiresInPlane
std::vector< unsigned int > nAnchoredWires
Encapsulate the construction of a single cyostat.
virtual bool HasROP(readout::ROPID const &ropid) const override
SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const override
Return the signal type of the specified channel.
WireGeo const & Wire(unsigned int iwire) const
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
virtual raw::ChannelID_t PlaneWireToChannel(unsigned int plane, unsigned int wire, unsigned int tpc, unsigned int cstat) const override
Returns the channel ID a wire is connected to.
std::vector< double > fSinOrientation
virtual double WireCoordinate(double YPos, double ZPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const override
Returns the index of the wire nearest to the specified position.
virtual WireID NearestWireID(const TVector3 &worldPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const override
Returns the ID of the wire nearest to the specified position.
The data type to uniquely identify a Plane.
unsigned int fPlanesPerAPA
std::set< PlaneID > fPlaneIDs
vector of the PlaneIDs present in the detector
Class identifying a set of TPC sharing readout channels.
CryostatID_t Cryostat
Index of cryostat.
Planes which measure Z direction.
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.
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.
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
std::set< View_t > const & Views() const
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const override
Returns the total number of TPC sets in the specified cryostat.
raw::ChannelID_t fTopChannel
book keeping highest channel #
unsigned int fChannelsPerAPA
PlaneInfoMap_t< PlaneData_t > fPlaneData
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.
TPCInfoMap_t< std::vector< T >> PlaneInfoMap_t
Data type for per-plane information.
std::vector< unsigned int > fNTPC
number of TPCs in each cryostat
unsigned int OpChannel(unsigned int detNum, unsigned int channel=0) const override
Returns the channel ID of the specified hardware channel.
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const override
Returns the total number of ROP in the specified TPC set.
ROPID_t ROP
Index of the readout plane within its TPC set.
Signal from induction planes.
void swap(Handle< T > &a, Handle< T > &b)
std::vector< double > fOrientation
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const override
virtual unsigned int MaxROPs() const override
enum geo::_plane_sigtype SigType_t
T get(std::string const &key) const
virtual std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const override
Returns a list of ID of TPCs the specified ROP spans.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
unsigned int NOpHardwareChannels(unsigned int opDet) const override
Returns the number of channels in the specified optical detectors.
Encapsulate the geometry of an auxiliary detector.
virtual readout::ROPID ChannelToROP(raw::ChannelID_t channel) const override
std::vector< double > fWirePitch
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
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.
void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()
virtual geo::PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const override
Returns the ID of the first plane belonging to the specified ROP.
void Initialize(GeometryData_t const &geodata) override
Geometry initialisation.
Class identifying a set of planes sharing readout channels.
TPCsetID_t TPCset
Index of the TPC set within its cryostat.
std::set< PlaneID > const & PlaneIDs() const override
Returns a list of the plane IDs in the whole detector.
Encapsulate the geometry of a wire.
virtual readout::TPCsetID TPCtoTPCset(geo::TPCID const &tpcid) const override
Returns the ID of the TPC set the specified TPC belongs to.
virtual readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const override
Returns the ID of the ROP planeid belongs to, or invalid if none.
virtual unsigned int MaxTPCsets() const override
unsigned int OpDetFromOpChannel(unsigned int opChannel) const override
Returns the optical detector the specified optical channel belongs.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Encapsulate the construction of a single detector plane.
unsigned int fNcryostat
number of cryostats in the detector
virtual std::vector< geo::PlaneID > ROPtoWirePlanes(readout::ROPID const &ropid) const override
Returns a list of ID of wire planes belonging to the specified ROP.
unsigned int HardwareChannelFromOpChannel(unsigned int opChannel) const override
Returns the hardware channel number of specified optical channel.
void GetEnd(double *xyz) const
unsigned int NOpChannels(unsigned int NOpDets) const override
Returns the number of optical channels contained in some detectors.
unsigned int Nwires() const
Number of wires in this plane.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
bool WireIDincreasesWithZ() const
Returns whether the higher z wires have higher wire ID.
unsigned int Nchannels() const override
Returns the total number of channels present (not necessarily contiguous)
all data we need for each APA
unsigned int WireID_t
Type for the ID number.
ChannelMapAPAAlg(fhicl::ParameterSet const &p)
Access the description of detector geometry.
unsigned int fChannelsPerOpDet
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
Data in the geometry description.
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.
recob::tracking::Plane Plane
LArSoft geometry interface.
virtual geo::TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const override
View_t View(raw::ChannelID_t const channel) const
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
Encapsulate the construction of a single detector plane.
Interface to algorithm class for a specific detector channel mapping.
The data type to uniquely identify a cryostat.
Signal from collection planes.
std::vector< double > fCosOrientation