39 std::vector<geo::CryostatGeo>
const& cgeo = geodata.
cryostats;
43 mf::LogInfo(
"ChannelMap35Alg") <<
"Initializing...";
78 for(
unsigned int a = 0;
a !=
fNTPC[
c]/2; ++
a){
84 double xyz_next[3] = {0.};
96 cgeo[
c].TPC(t).Plane(
p).Wire(
w).GetCenter(xyz);
97 cgeo[
c].TPC(t).Plane(
p).Wire(
w+1).GetCenter(xyz_next);
99 if(xyz[2]==xyz_next[2]){
142 for (
unsigned int tpc=0; tpc<
fNTPC[
cs]; tpc++){
147 double xyz[3]={0.0, 0.0, 0.0};
162 PlaneData.
fYmax = endpoint[1];
163 PlaneData.
fYmin = endpoint[1];
164 PlaneData.
fZmax = endpoint[2];
165 PlaneData.
fZmin = endpoint[2];
167 for (
unsigned int iwire=0;iwire<
nwires;iwire++){
185 fWirePitch[plane]=cgeo[0].TPC(0).WirePitch(plane);
186 fOrientation[plane]=cgeo[0].TPC(0).Plane(plane).Wire(0).ThetaZ();
221 throw cet::exception(
"Geometry") <<
"ILLEGAL CHANNEL ID for channel " << channel <<
"\n";
223 std::vector< WireID > AllSegments;
225 static unsigned int cstat;
226 static unsigned int tpc;
227 static unsigned int plane;
228 static unsigned int wireThisPlane;
229 static unsigned int NextPlane;
230 static unsigned int ThisPlane;
232 for(
unsigned int csloop = 0; csloop !=
fNcryostat; ++csloop){
234 bool breakVariable =
false;
236 for(
unsigned int apaloop = 0; apaloop !=
fNTPC[csloop]/2; ++apaloop){
237 for(
unsigned int planeloop = 0; planeloop !=
fPlanesPerAPA; ++planeloop){
242 if(channel < NextPlane){
247 wireThisPlane = channel - ThisPlane;
249 breakVariable =
true;
252 if(breakVariable)
break;
255 if(breakVariable)
break;
258 if(breakVariable)
break;
263 int WrapDirection = 1;
267 unsigned int bottomwire = wireThisPlane-ChannelGroup*
nAnchoredWires[cstat][tpc/2][plane];
269 if(ChannelGroup%2==1){
275 for(
unsigned int WireSegmentCount = 0; WireSegmentCount != 50; ++WireSegmentCount){
277 tpc += WrapDirection*(WireSegmentCount%2);
279 geo::WireID CodeWire(cstat, tpc, plane, bottomwire + WireSegmentCount*nAnchoredWires[cstat][std::floor(tpc/2)][plane]);
281 AllSegments.push_back(CodeWire);
284 tpc -= WrapDirection*(WireSegmentCount%2);
286 if( bottomwire + (WireSegmentCount+1)*nAnchoredWires[cstat][std::floor(tpc/2)][plane] >
307 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
330 const bool bSuppl = (planeid.
TPC % 2) == 1;
359 int NearestWireNumber
365 if(NearestWireNumber < 0 ||
368 const int wireNumber = NearestWireNumber;
370 if(wireNumber < 0 ) NearestWireNumber = 0;
391 unsigned int OtherSideWires = 0;
419 else{
mf::LogWarning(
"BadChannelSignalType") <<
"Channel " << channel
420 <<
" (" << chan <<
") not given signal type." <<
std::endl; }
436 else{
mf::LogWarning(
"BadChannelViewType") <<
"Channel " << channel
437 <<
" (" << chan <<
") not given view type.";}
464 if (opDet == 0 || opDet == 4 || opDet == 6)
478 unsigned int uniqueChannel = (detNum * 12) + channel;
479 return uniqueChannel;
485 unsigned int detectorNum = (
unsigned int) opChannel / 12;
492 unsigned int channel = opChannel % 12;
500 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
507 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
522 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
530 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
538 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
546 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
552 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
566 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
574 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
582 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
590 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
598 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
606 throw cet::exception(
"ChannelMap35Alg") << __func__ <<
" not implemented!\n";
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.
void GetStart(double *xyz) const
std::vector< unsigned int > fNTPC
number of TPCs in each cryostat
unsigned int fNcryostat
number of cryostats in the detector
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
virtual readout::ROPID ChannelToROP(raw::ChannelID_t channel) const override
T const & AccessAPAelement(PlaneInfoMap_t< T > const &data, geo::PlaneID planeid) const
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.
Encapsulate the construction of a single cyostat.
unsigned int fPlanesPerAPA
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const override
Returns the total number of ROP in the specified TPC set.
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 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.
virtual std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const override
Returns a list of ID of TPCs the specified ROP spans.
The data type to uniquely identify a Plane.
std::vector< double > fWirePitch
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const override
Returns the total number of TPC sets in the specified cryostat.
Class identifying a set of TPC sharing readout channels.
unsigned int Nchannels() const override
Returns the total number of channels present (not necessarily contiguous)
PlaneInfoMap_t< unsigned int > fWiresPerPlane
Planes which measure Z direction.
virtual bool HasROP(readout::ROPID const &ropid) const override
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.
unsigned int OpChannel(unsigned int detNum, unsigned int channel=0) const override
Returns the channel ID of the specified hardware channel.
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
std::set< View_t > fViews
vector of the views present in the detector
The class of 35t specific algorithms.
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.
virtual readout::TPCsetID TPCtoTPCset(geo::TPCID const &tpcid) const override
Returns the ID of the TPC set the specified TPC belongs to.
std::vector< double > fCosOrientation
raw::ChannelID_t fTopChannel
book keeping highest channel #
TPCInfoMap_t< std::vector< T >> PlaneInfoMap_t
Data type for per-plane information.
SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const override
Return the signal type of the specified channel.
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const override
std::vector< double > fOrientation
PlaneInfoMap_t< PlaneData_t > fPlaneData
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::set< PlaneID > const & PlaneIDs() const override
Returns a list of the plane IDs in the whole detector.
enum geo::_plane_sigtype SigType_t
virtual unsigned int MaxTPCsets() const override
View_t View(raw::ChannelID_t const channel) const
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Encapsulate the geometry of an auxiliary detector.
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.
Class identifying a set of planes sharing readout channels.
TPCsetID_t TPCset
Index of the TPC set within its cryostat.
unsigned int WiresPerPlane(geo::PlaneID const &planeid) const
Encapsulate the geometry of a wire.
virtual raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const override
Returns the ID of the first channel in the specified readout plane.
void Initialize(GeometryData_t const &geodata) override
Geometry initialisation.
std::vector< double > fSinOrientation
std::set< PlaneID > fPlaneIDs
vector of the PlaneIDs present in the detector
PlaneInfoMap_t< unsigned int > nAnchoredWires
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Encapsulate the construction of a single detector plane.
ChannelMap35Alg(fhicl::ParameterSet const &p)
std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const override
void GetEnd(double *xyz) const
all data we need for each APA
unsigned int OpDetFromOpChannel(unsigned int opChannel) const override
Returns the optical detector the specified optical channel belongs.
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.
virtual geo::PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const override
Returns the ID of the first plane belonging to the specified ROP.
std::set< View_t > const & Views() const
raw::ChannelID_t fChannelsPerAPA
void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()
virtual unsigned int MaxROPs() const override
unsigned int WireID_t
Type for the ID number.
virtual geo::TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const override
Access the description of detector geometry.
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
Data in the geometry description.
unsigned int fNchannels
number of channels in the detector
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.
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.
unsigned int HardwareChannelFromOpChannel(unsigned int opChannel) const override
Returns the hardware channel number of specified optical channel.
recob::tracking::Plane Plane
LArSoft geometry interface.
unsigned int AnchoredWires(geo::PlaneID const &planeid) const
virtual readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const override
Returns the ID of the ROP planeid belongs to, or invalid if none.
float fWireSortingInZ
+1 if the wire ID order follow z (larger z, or smaller intercept => larger wire ID); -1 otherwise ...
unsigned int NOpChannels(unsigned int NOpDets) const override
Returns the number of optical channels contained in some detectors.
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
Encapsulate the construction of a single detector plane.
The data type to uniquely identify a cryostat.
Signal from collection planes.
unsigned int NOpHardwareChannels(unsigned int opDet) const override
Returns the number of channels in the specified optical detectors.