Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event builder v2 tools #306

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,409 changes: 2,409 additions & 0 deletions UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.cpp

Large diffs are not rendered by default.

552 changes: 552 additions & 0 deletions UserTools/ANNIEEventTreeMaker/ANNIEEventTreeMaker.h

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions UserTools/ANNIEEventTreeMaker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ANNIEEventTreeMaker

ANNIEEventTreeMaker
This tool is the end tool of BeamClusterAnalysis, it takes the processed data as input, and dump the data into a root file.


## Data

This tool only work with the processed data generated by EventBuilderV2 tool chain.
The required data for different fill option is in it's fill function, please check code for details.


## Configuration

output_filename: the name of output root file

There are many fill options that will allow you fill different options. Please check code for details. Most of them are the same fill option like those in the PhaseIITreeMaker.
LAPPDReco_fill: this fill only works if the LAPPD reco tools are in the tool chain, it use the outputs from LAPPDThresReco tool.
381 changes: 381 additions & 0 deletions UserTools/EBLAPPD/EBLAPPD.cpp

Large diffs are not rendered by default.

95 changes: 95 additions & 0 deletions UserTools/EBLAPPD/EBLAPPD.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#ifndef EBLAPPD_H
#define EBLAPPD_H

#include <string>
#include <iostream>

#include "Tool.h"
#include "PsecData.h"
#include "BoostStore.h"

/**
* \class EBPMT
*
* $Author: Yue Feng $
* $Date: 2024/04 $
* Contact: [email protected]
*
*/

class EBLAPPD : public Tool
{

public:
EBLAPPD(); ///< Simple constructor
bool Initialise(std::string configfile, DataModel &data); ///< Initialise Function for setting up Tool resources. @param configfile The path and name of the dynamic configuration file to read in. @param data A reference to the transient data class used to pass information between Tools.
bool Execute(); ///< Execute function used to perform Tool purpose.
bool Finalise(); ///< Finalise function used to clean up resources.
bool LoadLAPPDData();
bool CleanData();
bool Matching(int targetTrigger, int matchToTrack);

private:
int thisRunNum;
bool matchToAllTriggers;
int exePerMatch;

PsecData dat;
uint64_t LAPPDBeamgate_ns;
uint64_t LAPPDTimestamp_ns;
uint64_t LAPPDOffset;
unsigned long LAPPDBeamgate_Raw;
unsigned long LAPPDTimestamp_Raw;
int LAPPDBGCorrection;
int LAPPDTSCorrection;
int LAPPDOffset_minus_ps;
uint64_t LAPPDBG_PPSBefore;
uint64_t LAPPDBG_PPSAfter;
uint64_t LAPPDBG_PPSDiff;
int LAPPDBG_PPSMissing;
uint64_t LAPPDTS_PPSBefore;
uint64_t LAPPDTS_PPSAfter;
uint64_t LAPPDTS_PPSDiff;
int LAPPDTS_PPSMissing;

vector<uint64_t> MatchBuffer_LAPPDTimestamp_ns; // used to indexing data for unmatched

// TODO, maybe make a new "LAPPDBuildData" class?
vector<uint64_t> Buffer_LAPPDTimestamp_ns; // used to indexing the data
vector<PsecData> Buffer_LAPPDData;
vector<uint64_t> Buffer_LAPPDBeamgate_ns;
vector<uint64_t> Buffer_LAPPDOffset;
vector<unsigned long> Buffer_LAPPDBeamgate_Raw;
vector<unsigned long> Buffer_LAPPDTimestamp_Raw;
vector<int> Buffer_LAPPDBGCorrection;
vector<int> Buffer_LAPPDTSCorrection;
vector<int> Buffer_LAPPDOffset_minus_ps;
vector<int> Buffer_RunCode;
vector<uint64_t> Buffer_LAPPDBG_PPSBefore;
vector<uint64_t> Buffer_LAPPDBG_PPSAfter;
vector<uint64_t> Buffer_LAPPDBG_PPSDiff;
vector<int> Buffer_LAPPDBG_PPSMissing;
vector<uint64_t> Buffer_LAPPDTS_PPSBefore;
vector<uint64_t> Buffer_LAPPDTS_PPSAfter;
vector<uint64_t> Buffer_LAPPDTS_PPSDiff;
vector<int> Buffer_LAPPDTS_PPSMissing;

std::map<int, vector<uint64_t>> PairedCTCTimeStamps;
std::map<int, vector<int>> PairedLAPPD_TriggerIndex;
std::map<int, vector<uint64_t>> PairedLAPPDTimeStamps;

int matchTargetTrigger;
uint64_t matchTolerance_ns;
int verbosityEBLAPPD;

int matchedLAPPDNumber = 0;
int exeNum = 0;
int currentRunCode;

int v_message = 1;
int v_warning = 2;
int v_error = 3;
int v_debug = 4;
};

#endif
35 changes: 35 additions & 0 deletions UserTools/EBLAPPD/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# EBLAPPD

EBLAPPD tool is a part of Event Building version 2 tool chain.
For reference slides, see:
https://annie-docdb.fnal.gov/cgi-bin/sso/ShowDocument?docid=5633

EBLAPPD match the LAPPD beamgate + LAPPD offset to grouped trigger, and save the matching results to CStore for EBSaver.

## Data

**PairedCTCTimeStamps**
After matching, the matched trigger timestamp will be saved here. The key is the main trigger word for each run type.
Saved as PairedLAPPDTriggerTimestamp in CStore.

**PairedLAPPDTimeStamps**
After matching, the matched LAPPD beamgate + offset will be saved here. The key is the main trigger word for each run type.
This and PairedCTCTimeStamps have the same index. A little bit dangerous, but overall works well.
Saved as PairedLAPPDTimeStamps in CStore


## Configuration

**matchTargetTrigger**
This gives which trigger word that the LAPPD beamgate + offset should be matched to.

**matchTolerance_ns**
This gives the maximum allowed time tolerance between the LAPPD beamgate + offset and the target trigger timestamp.

**exePerMatch**
This gives how many loops need to be past for one matching between MLAPPD beamgate + offset and target trigger timestamps.
500 is generally fine with beam runs.

**matchToAllTriggers**
1 or 0. 1 means match to all possible triggers, 0 means only match to the target trigger.

Loading
Loading