47 std::vector<geo::CryostatGeo>
const& cgeo = geodata.
cryostats;
51 mf::LogInfo(
"ChannelMap35OptAlg") <<
"Initializing...";
86 for(
unsigned int a = 0;
a !=
fNTPC[
c]/2; ++
a){
92 double xyz_next[3] = {0.};
104 cgeo[
c].TPC(t).Plane(
p).Wire(
w).GetCenter(xyz);
105 cgeo[
c].TPC(t).Plane(
p).Wire(
w+1).GetCenter(xyz_next);
107 if(xyz[2]==xyz_next[2]){
149 for (
unsigned int tpc=0; tpc<
fNTPC[
cs]; tpc++){
154 double xyz[3]={0.0, 0.0, 0.0};
169 PlaneData.
fYmax = endpoint[1];
170 PlaneData.
fYmin = endpoint[1];
171 PlaneData.
fZmax = endpoint[2];
172 PlaneData.
fZmin = endpoint[2];
174 for (
unsigned int iwire=0;iwire<
nwires;iwire++){
193 fWirePitch[plane]=cgeo[0].TPC(0).WirePitch(plane);
194 fOrientation[plane]=cgeo[0].TPC(0).Plane(plane).Wire(0).ThetaZ();
225 throw cet::exception(
"Geometry") <<
"ILLEGAL CHANNEL ID for channel " << channel <<
"\n";
227 std::vector< WireID > AllSegments;
229 static unsigned int cstat;
230 static unsigned int tpc;
231 static unsigned int plane;
232 static unsigned int wireThisPlane;
233 static unsigned int NextPlane;
234 static unsigned int ThisPlane;
236 for(
unsigned int csloop = 0; csloop !=
fNcryostat; ++csloop){
238 bool breakVariable =
false;
240 for(
unsigned int apaloop = 0; apaloop !=
fNTPC[csloop]/2; ++apaloop){
241 for(
unsigned int planeloop = 0; planeloop !=
fPlanesPerAPA; ++planeloop){
246 if(channel < NextPlane){
251 wireThisPlane = channel - ThisPlane;
253 breakVariable =
true;
256 if(breakVariable)
break;
259 if(breakVariable)
break;
262 if(breakVariable)
break;
267 int WrapDirection = 1;
271 unsigned int bottomwire = wireThisPlane-ChannelGroup*
nAnchoredWires[cstat][tpc/2][plane];
273 if(ChannelGroup%2==1){
279 for(
unsigned int WireSegmentCount = 0; WireSegmentCount != 50; ++WireSegmentCount){
281 tpc += WrapDirection*(WireSegmentCount%2);
283 geo::WireID CodeWire(cstat, tpc, plane, bottomwire + WireSegmentCount*nAnchoredWires[cstat][std::floor(tpc/2)][plane]);
285 AllSegments.push_back(CodeWire);
288 tpc -= WrapDirection*(WireSegmentCount%2);
290 if( bottomwire + (WireSegmentCount+1)*nAnchoredWires[cstat][std::floor(tpc/2)][plane] >
311 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
334 const bool bSuppl = (planeid.
TPC % 2) == 1;
363 int NearestWireNumber
369 if(NearestWireNumber < 0 ||
372 const int wireNumber = NearestWireNumber;
374 if(wireNumber < 0 ) NearestWireNumber = 0;
395 unsigned int OtherSideWires = 0;
423 else{
mf::LogWarning(
"BadChannelSignalType") <<
"Channel " << channel
424 <<
" (" << chan <<
") not given signal type." <<
std::endl; }
440 else{
mf::LogWarning(
"BadChannelViewType") <<
"Channel " << channel
441 <<
" (" << chan <<
") not given view type.";}
468 if (opDet == 0 || opDet == 4 || opDet == 6)
482 unsigned int uniqueChannel = (detNum * 12) + channel;
483 return uniqueChannel;
489 unsigned int detectorNum = (
unsigned int) opChannel / 12;
496 unsigned int channel = opChannel % 12;
504 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
511 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
526 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
534 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
542 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
550 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
556 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
570 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
578 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
586 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
594 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
602 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
610 throw cet::exception(
"ChannelMap35OptAlg") << __func__ <<
" not implemented!\n";
void GetStart(double *xyz) const
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
virtual readout::TPCsetID TPCtoTPCset(geo::TPCID const &tpcid) const override
Returns the ID of the TPC set the specified TPC belongs to.
std::set< PlaneID > fPlaneIDs
vector of the PlaneIDs present in the detector
raw::ChannelID_t fChannelsPerAPA
Encapsulate the construction of a single cyostat.
unsigned int NOpHardwareChannels(unsigned int opDet) const override
Returns the number of channels in the specified optical detectors.
PlaneInfoMap_t< unsigned int > nAnchoredWires
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 unsigned int MaxROPs() 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 OpChannel(unsigned int detNum, unsigned int channel=0) const override
Returns the channel ID of the specified hardware channel.
virtual readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const override
Returns the ID of the ROP planeid belongs to, or invalid if none.
The data type to uniquely identify a Plane.
unsigned int NOpChannels(unsigned int NOpDets) const override
Returns the number of optical channels contained in some detectors.
Class identifying a set of TPC sharing readout channels.
Planes which measure Z direction.
std::set< View_t > fViews
vector of the views present in the detector
WireID_t Wire
Index of the wire within its plane.
std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const override
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
virtual std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const override
Returns a list of ID of TPCs the specified ROP spans.
virtual bool HasROP(readout::ROPID const &ropid) const override
TPCInfoMap_t< std::vector< T >> PlaneInfoMap_t
Data type for per-plane information.
raw::ChannelID_t fTopChannel
book keeping highest channel #
SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const override
Return the signal type of the specified channel.
std::set< View_t > const & Views() const
all data we need for each APA
ROPID_t ROP
Index of the readout plane within its TPC set.
void Initialize(GeometryData_t const &geodata) override
Geometry initialisation.
Signal from induction planes.
void swap(Handle< T > &a, Handle< T > &b)
enum geo::_plane_sigtype SigType_t
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
unsigned int HardwareChannelFromOpChannel(unsigned int opChannel) const override
Returns the hardware channel number of specified optical channel.
Encapsulate the geometry of an auxiliary detector.
View_t View(raw::ChannelID_t const channel) const
unsigned int AnchoredWires(geo::PlaneID const &planeid) const
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
static int max(int a, int b)
void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()
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 TPC.
PlaneID_t Plane
Index of the plane within its TPC.
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 unsigned int MaxTPCsets() const override
PlaneInfoMap_t< PlaneData_t > fPlaneData
float fWireSortingInZ
+1 if the wire ID order follow z (larger z, or smaller intercept => larger wire ID); -1 otherwise ...
unsigned int fNcryostat
number of cryostats in the detector
Class identifying a set of planes sharing readout channels.
unsigned int fNchannels
number of channels in the detector
TPCsetID_t TPCset
Index of the TPC set within its cryostat.
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const override
Returns the total number of TPC sets in the specified cryostat.
Encapsulate the geometry of a wire.
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.
PlaneInfoMap_t< unsigned int > fWiresPerPlane
unsigned int OpDetFromOpChannel(unsigned int opChannel) const override
Returns the optical detector the specified optical channel belongs.
std::vector< unsigned int > fNTPC
number of TPCs in each cryostat
std::vector< double > fOrientation
unsigned int fPlanesPerAPA
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Encapsulate the construction of a single detector plane.
std::set< PlaneID > const & PlaneIDs() const override
Returns a list of the plane IDs in the whole detector.
void GetEnd(double *xyz) const
virtual readout::ROPID ChannelToROP(raw::ChannelID_t channel) const override
virtual geo::PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const override
Returns the ID of the first plane belonging to the specified ROP.
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const override
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::TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const override
unsigned int Nchannels() const override
Returns the total number of channels present (not necessarily contiguous)
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.
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.
ChannelMap35OptAlg(fhicl::ParameterSet const &p)
unsigned int WireID_t
Type for the ID number.
Access the description of detector geometry.
The class of 35t specific algorithms, optimized.
std::vector< double > fWirePitch
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.
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.
recob::tracking::Plane Plane
unsigned int WiresPerPlane(geo::PlaneID const &planeid) const
LArSoft geometry interface.
std::vector< double > fSinOrientation
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.
std::vector< double > fCosOrientation
Signal from collection planes.