157 std::unique_ptr<std::vector<raw::Trigger> > trigger_v(
new std::vector<raw::Trigger> );
160 std::unique_ptr<std::vector<sim::SimChannel> > simch_v(
new std::vector<sim::SimChannel> );
162 std::unique_ptr<std::vector<sim::SimEnergyDeposit>> simDep_v(
new std::vector<sim::SimEnergyDeposit>);
166 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(
e);
167 art::ServiceHandle<geo::Geometry> geo;
169 auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob(clockData);
182 for(
size_t index=0; index <
fSimTime_v.size(); ++index) {
184 int tdc =
fSimTime_v[index] / clockData.TPCClock().TickPeriod();
185 fTick_v.push_back(clockData.TPCTDC2Tick(tdc));
188 std::cout <<
"[BUFFOON!] Charge injection id " << index <<
" @ TDC=" << tdc
189 <<
" @ Y=" <<
fY_v[index] <<
" @ Z=" <<
fZ_v[index]
194 <<
" as it results in negative TDC (invalid)" << std::endl;
200 TVector3 planeCoords = planeGeo.
GetCenter();
207 pulse_record.
tdc = tdc;
209 pulse_record.
tick = clockData.TPCTDC2Tick(tdc);
214 std::cout <<
"==> x position of plane 0: " << planeCoords[0] <<
", normal: " << planeNormal[0] <<
", nElec: " <<
fNumElectrons_v[index] <<
", nElecADC: " << nElecADC <<
", edep: " << eDeposit << std::endl;
215 std::cout <<
" x position of charge deposit: " << chargeDepCoords.X() << std::endl;
217 simDep_v->emplace_back(0,
221 geo::Point_t(chargeDepCoords.X(),chargeDepCoords.Y()+0.001,chargeDepCoords.Z()+0.001),
222 geo::Point_t(chargeDepCoords.X(),chargeDepCoords.Y()-0.001,chargeDepCoords.Z()-0.001));
226 for(
size_t plane=0; plane<3; ++plane) {
228 double xyz[3] = {chargeDepCoords.X(),chargeDepCoords.Y(),chargeDepCoords.Z()};
230 std::cout <<
"++ Searching for nearest wire id for planeID: " << planeID <<
", xyz: " << xyz[0] <<
"," << xyz[1] <<
"," << xyz[2] << std::endl;
231 geo::WireID nearestID = geo->NearestWireID(xyz,plane);
232 std::cout <<
" WireID: " << nearestID << std::endl;
233 std::cout <<
"** Searching for nearest channel with plane: " << plane <<
", xyz: " << xyz[0] <<
"," << xyz[1] <<
"," << xyz[2] << std::endl;
234 auto channel = geo->NearestChannel(xyz,plane);
235 std::cout <<
" Returned with channel: " << channel << std::endl;
236 auto wire = geo->ChannelToWire(channel).front().Wire;
237 std::cout <<
" which gives wire: " << wire << std::endl;
239 << channel <<
" ... wire " << wire << std::endl;
246 std::cerr <<
"[BUFFOON!] unexpected plane! " << plane << std::endl;
247 throw std::exception();
250 unsigned planeTDC = clockData.TPCTick2TDC(pulse_record.
tick +
detProp.GetXTicksOffset(planeID) -
detProp.GetXTicksOffset(collectionPlaneID));
251 sch.AddIonizationElectrons(1,
252 (
unsigned int)planeTDC,
256 simch_v->emplace_back(std::move(sch));
258 pholder.Register(std::move(pulse_record));
266 e.put(std::move(simch_v));
267 e.put(std::move(simDep_v));
268 e.put(std::move(trigger_v));
std::vector< int > fPlane1Channel_v
Resulting plane 1 channel number where charge is deposited.
static ParamHolder & get()
Energy deposited on a readout channel by simulated tracks.
BEGIN_PROLOG could also be cerr
TTree * fTupleTree
output analysis tree
std::vector< double > fSimTime_v
Charge timing in electronics clock [us].
The data type to uniquely identify a Plane.
std::vector< double > fNumElectrons_v
Charge amount in electron count.
std::vector< int > fPlane2Wire_v
Resulting plane 2 wire number where charge is deposited.
Vector GetNormalDirection() const
Returns the direction normal to the plane.
std::vector< int > fPlane0Channel_v
Resulting plane 0 channel number where charge is deposited.
std::vector< int > fPlane2Channel_v
Resulting plane 2 channel number where charge is deposited.
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...
std::vector< int > fPlane0Wire_v
Resulting plane 0 wire number where charge is deposited.
std::vector< int > fTick_v
Corresponding tick.
std::array< int, 3 > channel_list
double fTriggerTime
Trigger timing in electronics clock [us].
std::vector< double > fY_v
Charge Y position in detector coordinate [cm].
std::vector< int > fPlane1Wire_v
Resulting plane 1 wire number where charge is deposited.
std::vector< double > fZ_v
Charge Z position in detector coordinate [cm].
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