Using the stitcher/splitter module¶
As the data coming from the DAQ will have particles entering at random times it will be necessary to both stitch events (provided timestamps overlap) and also to split events so that we can have only 1 drift window of data per event (as this is much easier to reconstruct).
The stitcher/splitter code is in dunetpc/dune/daqinput35t/SplitterInput_source.cc.
There is an example fcl file in dunetpc/dune/daqinput35t/RunSpliterDefault.fcl.
There is an example fcl file for running on monte carlo data dunetpc/dune/daqinput35t/RunSpliterDefault_MC.fcl.
- You have to be sure to specify the input tags correctly for the file which you are using (explained below).
- You can specify whatever trigger you want, currently written triggers are;
- WhichTrigger = 0 corresponds to Making a trigger after a user-defined number of ticks - not hugely useful
- WhichTrigger = 1 corresponds to Triggering on each new ADC payload - current default
- WhichTrigger = 2 corresponds to Triggering using SSP information - number of waveforms above a threshold you define.
- WhichTrigger = 3 corresponds to Triggering on The PTB Triggers you specify which PTB Triggers using source.PTBTrigs: [ 111, 112, 113 ]
- WhichTrigger = 4 corresponds to Triggering on TPC ADC difference - 'Tickler Trigger'
- WhichTrigger = X corresponds to YOUR TRIGGER.....
- Note that WhichTrigger is a vector and so is declared as; source.WhichTrigger: [ 3 ]
- Configure how many ticks you want before and after the trigger.
- PreTriggerTicks - The number of TPC ticks before a trigger you want in an output event.
- PostTriggerTicks - The number of TPC ticks after a trigger you want in an output event.
- If there are not enough ticks to satisfy PreTriggerTicks, then the previous event with ticks in is loaded and the timestamps checked. If the timestamps do not lead then the trigger is voided. The same is done for PostTriggerTicks.
The basic current structure of the code¶
- It uses structs to hold the RCE, PTB and SSP data which it gathers from the event.
- It loops through each tick of each event and looks if it can trigger on a given tick by calling the trigger functions.
- If it can trigger then it moves back a user specified number of ticks and begins collecting ticks for the event.
- If there are not enough ticks in the event to satisfy this then it loads the previous event and checks the timestamps between the event.
- If they match then it will make the event, if they don't then it will abandon this trigger and move onto the next tick from where the failed trigger was.
The trigger to use is determined through a series of if/else statements. This was just because it is the easiest thing to code, I hold no feeling towards switching that to cases etc if someone feels that is better.
Specifying which trigger to use¶
Multiple trigger types are now supported, this is why WhichTrigger is a vector configured as a fcl parameter.
If you want to add a new trigger then edit the call to the triggering function as desired and add your trigger to the end of the list of if/else statements (following the example of TicklerTrigger). Please also add it to the list at the top of this Wiki so that other people can use it.
Specifying the input tags correctly¶
The input tags of files are very different for Monte Carlo and data, so you need to specify these correctly!
This is why there are two fcl files, one for data and one for MC.
If you wish to swap between the two yourself then look in dunetpc/dune/daqinput35t/SpliterInput.fcl.
DebugLevel¶There are levels of output from the module. This is controlled by the parameter DebugLevel.
- 0 - no output other than telling you it has made an event.
- 1 - General information about what the module is doing, ie where it triggered.
- 2 - Some information on the RCE, SSP and PTB information loaded from the input event, and written to the output event.
- 4+ - Lots of information, such as ADC counts on each channel in the output and pedestal values loaded.
Using the split data downstream¶
If you have ran the splitter on real data use these fcl paramers
For RCE information "SplitterInput:TPC" For SSP information "SplitterInput:PHOTON" For PTB information "SplitterInput:TRIGGER"
If you have ran the splitter on monte carlo use these fcl paramers
For RCE information "SplitterInput" For SSP information "SplitterInput" For PTB information "SplitterInput"
When you want to do reconstruction you need to change these fcl parameters;
Note that the cheated stuff obviously won't work on real data!
physics.producers.opflash.InputModule: "SplitterInput" physics.producers.t0counter.SimCounterModuleLabel: "SplitterInput" physics.producers.caldata.DigitModuleLabel: "SplitterInput" physics.producers.hitcheat.G4ModuleLabel: "SplitterInput" physics.producers.clustercheat.G4ModuleLabel: "SplitterInput" physics.producers.trackcheat.G4ModuleLabel: "SplitterInput" physics.producers.pandoradc.GeantModuleLabel: "SplitterInput" physics.producers.pandora.GeantModuleLabel: "SplitterInput" services.user.BackTracker.G4ModuleLabel: "SplitterInput"
Description of other fcl parameters (taken from the default fcl file /dunetpc/dune/daqinput35t/SplitterInput.fcl)¶
TPCInputTag: "daq:TPC:DAQ" // Input tag of TPC data "moduleLabel:instance:processName" SSPInputTag: "daq:PHOTON:DAQ" // Input tag of SSP data "moduleLabel:instance:processName" PennInputTag: "daq:TRIGGER:DAQ" // Input tag of PTB data "moduleLabel:instance:processName" TPCInputDataProduct: "artdaq::Fragment" // Data product type of TPC data SSPInputDataProduct: "artdaq::Fragment" // Data product type of SSP data PennInputDataProduct: "artdaq::Fragment" // Data product type of PTB data SSPReformatter: @local::ssp_reformatter // The parameter set for the SSP reformatter TPCChannelMapFile: "rce_channel_map_dune35t.txt" // The TPC channel map RequireRCE: "true" // Do you require the RCEs to be present? RequireSSP: "true" // Do you require the SSPs to be present? RequirePTB: "true" // Do you require the PTB to be present? DebugLevel: 1 // The level of information printed out 0 = none, 1 = basic info, <4 = all TimeStampThreshold: 5 // The threshold for trying to mitigate any timestamp ideosynchrosies WhichTrigger: 1 // Which trigger to use - see Triggering function PostTriggerTicks: 15000 // The number of TPC ticks gathered, post trigger PreTriggerTicks: 0 // The number of TPC ticks gathered, pre trigger TrigSeparation: 0 // The minimum separation between triggers. MCTrigLevel: 0 // The threshold for the 'trigger every X TPC ticks trigger.' NovaTicksPerTPCTick: 32 // The number of Nova ticks per TPC tick NovaTicksPerSSPTick: 1 // The number of Nova ticks per SSP tick NovaTicksPerCountTick: 32 // The number of Noca ticks per PTB tick WaveformADCThreshold: 1550 // The SSP ADC threshold to be used in SSP waveform trigger WaveformADCsOverThreshold: 10 // The number of channels required over threshold in SSP ADC trigger ADCdiffThreshold: 40 // The threshold for the change in TPC ADC trigger ADCsOverThreshold: 1000 // The number of channels to satisfy the above threshold to have a TPC ADC trigger UsePedestalDefault: "false" // Whether to use the default pedestal values UsePedestalFile: "false" // Whether to use a pedestal file. If false, uses the online database. PedestalFile: "" // What pedestal file to use (if one is used at all)
Things which still need to be done.....¶
- The splitter used to seg fault if there was no RCE information. I have now changed it so that it just spits out all of the OpDetWaveform, OpHit and ExternalTrigger information for that microslice. This probably wants a little further thinking about to how to handle a sophisticated triggering mechanism.
- There was some mention of saving all the headers of the events used in the splitting / stitching. I have no idea how to do this though (though I haven't looked).
- Try to increase the speed of making events by filling the digits buffer more efficiently. This may require focusing on tpcFragmentsToRawDigits.cc.