170 std::unique_ptr<std::vector<raw::Trigger> > trigger_v(
new std::vector<raw::Trigger> );
173 std::unique_ptr<std::vector<sim::SimChannel> > simch_v(
new std::vector<sim::SimChannel> );
175 std::unique_ptr<std::vector<sim::SimEnergyDeposit>> simDep_v(
new std::vector<sim::SimEnergyDeposit>);
179 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService>()->DataFor(
e);
180 art::ServiceHandle<geo::Geometry> geo;
182 auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob(clockData);
195 for(
size_t index=0; index <
fSimTime_v.size(); ++index) {
197 int tdc =
fSimTime_v[index] / clockData.TPCClock().TickPeriod();
198 fTick_v.push_back(clockData.TPCTDC2Tick(tdc));
201 std::cout <<
"[BUFFOON!] Charge injection id " << index <<
" @ TDC=" << tdc
207 <<
" as it results in negative TDC (invalid)" << std::endl;
213 TVector3 planeCoords = planeGeo.
GetCenter();
217 chargeDepCoords =
geo::Point_t(planeCoords[0] + 1. * planeNormal[0],planeCoords[1],planeCoords[2]);
220 pulse_record.
tdc = tdc;
222 pulse_record.
tick = clockData.TPCTDC2Tick(tdc);
226 std::cout <<
"==> x position of plane 0: " << planeCoords[0] <<
", normal: " << planeNormal[0] <<
", nElec: " <<
fNumElectrons_v[index] <<
", nElecADC: " << nElecADC << std::endl;
228 simDep_v->emplace_back(0,
fNumElectrons_v[index],0.,nElecADC,chargeDepCoords,chargeDepCoords);
230 for(
size_t plane=0; plane<3; ++plane)
241 std::vector<geo::WireID> wireIDVec = geo->ChannelToWire(channel);
243 std::cout <<
">>Channel " << channel <<
", C/T/P/W: " << wireID.Cryostat <<
"/" << wireID.TPC <<
"/" << wireID.Plane <<
"/" << wireID.Wire
244 <<
" returns " << wireIDVec.size() <<
" IDs, C/T/P/W: " << wireIDVec.front().Cryostat <<
"/" << wireIDVec.front().TPC <<
"/" << wireIDVec.front().Plane <<
"/" << wireIDVec.front().Wire << std::endl;
253 xyz[0] = chargeDepCoords.X();
255 Position position = {xyz[0],xyz[1],xyz[2]};
259 if(
fVerbose)
std::cout <<
"[BUFFOON!] plane " << plane <<
" channel " << channel <<
" ... wire " << wire << std::endl;
265 sch.AddIonizationElectrons(1,
270 simch_v->emplace_back(std::move(sch));
273 pholder.Register(std::move(pulse_record));
281 e.put(std::move(simch_v));
282 e.put(std::move(simDep_v));
283 e.put(std::move(trigger_v));
WireVecVec fWiresByPlaneVec
For each plane the wires to deposit charge on.
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
static ParamHolder & get()
Energy deposited on a readout channel by simulated tracks.
BEGIN_PROLOG could also be cerr
unsigned int fTPC
TPC in that cryostat (0-3 for split wire)
The data type to uniquely identify a Plane.
Vector GetNormalDirection() const
Returns the direction normal to the plane.
WireVec fTick_v
Corresponding tick.
PositionVecVec fPlanePositionVecVec
Keep track of positions for each wire on each plane.
Point GetCenter() const
Returns the centre of the wire plane in world coordinates [cm].
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
WireVecVec fPlaneChannelVec
Keep track of wires for each plane.
std::array< int, 3 > channel_list
std::vector< double > Position
unsigned int fCryostat
Cryostat to consider.
double fTriggerTime
Trigger timing in electronics clock [us].
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
TTree * fTupleTree
output analysis tree
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
BEGIN_PROLOG could also be cout
std::vector< double > fNumElectrons_v
Charge amount in electron count.
std::vector< double > fSimTime_v
Charge timing in electronics clock [us].