Project

General

Profile

Simulate horizontal-ish muons that trigger the counters on the cryostat walls

Last update: April 22, 2015

Generating muons

You need to know where the counters are: TSU Counter Locations

Example prod_single.fcl file that was used to generate muons crossing the west-east counters.
This file has
  • 3 Gev muons
  • at fixed angle that points from west counters to east counters in the plane parallel to the wire plane
  • starting position (x,y) randomly chosen roughly just outside the west counters (z fixed)
Another example prodmany_NS.fcl file that generates muons crossing north to south counters (APA crossers for t0 studies)
This file has
  • 3 Gev muons
  • starting position randomly chosen on the south upper counters
  • direction towards the north lower counters, but with some random smearing

Two more examples prodmany_SN.fcl and prodmany_down.fcl

How to know whether a particular counter was on for an event in your analysis module?

( See analysis module attached HitDumper_module.cc for complete implementation, also has alternate
implementation good only for simulated data)
Make sure to include this header file:
#include "RawData/ExternalTrigger.h"
Then in the event loop (typically the Analyze() function) you can do something like this
which fills an array of flags that tells whether each counter was on or off

art::Handle< std::vector< raw::ExternalTrigger> > externalTriggerListHandle;
evt.getByLabel(fCounterModuleLabel, externalTriggerListHandle);
std::vector< art::Ptr< raw::ExternalTrigger> > trigs;
art::fill_ptr_vector(trigs,externalTriggerListHandle);
// --
t0 = detprop->TriggerOffset(); // units of TPC ticks
// int nhits = externalTriggerListHandle->size();
// std::cout << "number of counter hits is " << nhits << std::endl;
for (auto const& trig : trigs) {
int auxdetid = trig->GetTrigID();
int tick = trig->GetTrigTime();
std::cout << "Counter hit " << auxdetid << " " << tick << std::endl;
// convert Penn Board ticks to TPC ticks
// fCombinedTimeDelay=160 ns is the cable delay offset used in counter simulation
// detprop->SamplingRate(); //time sample in ns
// fTimeService->TriggerOffsetTPC()*1.e3; // ns
// --
float realtime = (tick+0.5)*32.0 - fCombinedTimeDelay;
float TPCticks = realtime/detprop->SamplingRate()-t0;
// this timing cut only works if there was no timing offset in the simulation
// i.e. physics.producers.generator.T0: [0.] # in ns in the main fcl file (prod_single)
if (TPCticks<=1 && TPCticks>=-1) {
std::cout << "good counter hit " << auxdetid << std::endl;
counter_flag[auxdetid]=1;
}
}

The above code looks at a list of counter hits stored in the data product ExternalTriggers.
In the case of simulation, this is filled from the energy deposited in the counters by the
primary particles in the simulated event. In the case of data, the ExternalTriggers data
product is filled with actual counter hits. The code above should work for either case.