6#define CBMRECOQATASK_H 1
13#include <TDirectoryFile.h>
61#define kNtrkProjections 6
109 static int GetPlaneId(
const Node& node) {
return node.userReferences[3]; }
110 static void SetPlaneId(Node& node,
int planeId) { node.userReferences[3] = planeId; }
135 bool Load(
const Trajectory::Node* n,
const FairMCPoint* point,
const int dinfo = 0xab00);
136 bool Load(TVector3* p, TVector3* pe =
nullptr);
147 std::map<eProjectionType, std::tuple<int, float, TH1*>>
fProjection =
162 bool Init(
const char* dname,
bool mc =
false);
171 std::string
makeTrange(
const int scale,
float& range);
172 std::string
makeYrange(
const int scale,
float& range);
188 View*
AddView(
const char* n,
const char* p, std::vector<int> set,
bool debug =
false);
195 bool Init(TDirectoryFile* f,
bool mc =
false);
221 template<ECbmModuleId d>
228 std::vector<std::array<float, projSz>>
fRef = {};
263 bool AddTopoCut(std::vector<int> cuts,
const char opt);
322 template<ECbmModuleId d>
333 virtual InitStatus
Init();
335 virtual void Exec(Option_t* option);
344 std::vector<TString>
GetPath(TGeoNode* node, TString, TString activeNodeName,
int depth = 0,
345 const TString& path =
"");
360 template<ECbmModuleId d>
394 std::map<ECbmModuleId, TClonesArray*>
MapDataList(std::string& s)
const;
398 std::map<ECbmModuleId, TClonesArray*>
fTracks = {};
402 std::map<ECbmModuleId, TClonesArray*>
fHits = {};
404 std::map<ECbmModuleId, CbmMCDataArray*>
fPoints = {};
409 TDirectoryFile
fOutFolder = {
"RecoQA",
"CA track driven reco QA"};
411 std::map<ECbmModuleId, Detector>
fDetQa = {};
ECbmDataType
Enumerator for CBM data types.
ECbmModuleId
Enumerator for module Identifiers.
Base class for cluster objects.
Class characterising one event by a collection of links (indices) to data objects,...
Access to a MC data branch for time-based analysis.
Task class creating and managing CbmMCDataArray objects.
void SetPlaneId(size_t inode, int planeId)
static void SetPlaneId(Node &node, int planeId)
static int GetPlaneId(const Node &node)
int GetDebugInfo(const CbmHit *h)
Detector specific extra info.
CbmMCDataManager * cbm_mc_manager
static constexpr size_t stsSz
static constexpr size_t projSz
Define the identifiers of the sensors from each tracking layer of the setup to be considered in the p...
std::vector< TVector3 > fPrjPlanes
list of QA views
void UseMC(bool set=true)
ClassDef(CbmRecoQaTask, 1)
local storage for the z positions of track projection planes
std::map< ECbmModuleId, TClonesArray * > MapDataList(std::string &s) const
link the right data list for the data type (Hit, Tracks, Clusters)
std::map< ECbmModuleId, TClonesArray * > fHitMatch
mc points
int GetNviews(eViewType type) const
count views types registered with the task
virtual EventFilter * AddEventFilter(EventFilter::eEventCut cut)
virtual Detector * GetDetector(ECbmModuleId did)
std::map< ECbmModuleId, CbmMCDataArray * > fPoints
reconstructed Clusters
CbmRecoQaTask & operator=(const CbmRecoQaTask &)
CbmRecoQaTask(const CbmRecoQaTask &)
TClonesArray * fEvents
MC info for the global tracks.
static std::bitset< kRecoQaNConfigs > fuRecoConfig
virtual bool FilterTrack(const CbmGlobalTrack *ptr) const
Filter tracks based on cuts. The cuts describe track composition (type of detector hit attached) and ...
std::map< ECbmModuleId, Detector > fDetQa
void Activate(ECbmModuleId det, bool set=true)
Explcitely Activate/Deactivate detector for tracking. If set to false, the detector is QAed but it is...
virtual void Exec(Option_t *option)
Executed task.
std::map< ECbmModuleId, TClonesArray * > fHits
Time slice info.
std::vector< EventFilter > fFilterEv
reconstructed hits
std::vector< TrackFilter > fFilterTrk
static size_t GetHitDetectorId(const CbmHit *h, std::vector< int > &sel)
Retrieve detector specific hit to sensor identification array.
@ kXdXT
X to TRK residuals w.r.t MC points.
@ kPVxsx
y-z projection of the primary vertex:
@ kPVyz
x-z projection of the primary vertex:
@ kDebug1
debug slot for detectors
@ kXYh
Time to EV residuals as function of coordinate in view.
@ kPVxy
Residual distribution T:
@ kResidualX
Pull distribution Y:
@ kDmult
X-Y hit coorelation in local view.
@ kXYt3
X-Y track projections on a random plane (value 2)
@ kXYt5
X-Y track projections on a random plane (value 4)
@ kXYhMC
local view MC point multiplicity
@ kYpY
X to TRK pulls as function of local X in view.
@ kXYt1
X-Y track projections on a random plane (value 0)
@ kYdYMC
Y to TRK residuals as function of local Y in view.
@ kResidualY
Residual distribution X: (x_RC - x_MC) in cm.
@ kPVzsz
y-sy projection of the primary vertex:
@ kPullX
X-Y MC point coorelation in local view (using HitMatch)
@ kResidualTX
Residual distribution Y:
@ kDebug0
X-Y track projections on a random plane (value 5)
@ kXYt0
z-sz projection of the primary vertex:
@ kPVysy
x-sx projection of the primary vertex:
@ kXYt2
X-Y track projections on a random plane (value 1)
@ kResidualTY
Residual distribution T:
@ kXdX
X-Y track projections on detection unit.
@ kPullY
Pull distribution X: (RC - MC) / dx_RC.
@ kXYp
X-Y hit coorelation in track filtered data.
@ kPVmult
y-z projection of the primary vertex:
@ kYdY
TRK errors in X direction as function of local X.
@ kYdYT
Y to TRK residuals w.r.t MC points.
@ kXdXMC
X to TRK residuals as function of local X in view.
@ kWdT
TRK errors in Y direction as function of local Y.
@ kPVxz
x-y projection of the primary vertex:
@ kXYt4
X-Y track projections on a random plane (value 3)
@ kDmultMC
local view hit multiplicity
@ kChdT
Y to TRK pulls as function of local Y in view.
CbmTimeSlice * fTimeSlice
reconstructed events
@ kTrdHits
has STS hits (StsHit branch)
@ kMuchHits
has Rich hits (RichHit branch)
@ kUseMC
has Much hits (MuchHit branch)
@ kRichHits
has ToF hits (TofHit branch)
@ kRecoQaNConfigs
use ToF hits in track refit
@ kUseSts
use MC even if available
@ kStsHits
has tracks reconstructed (GlobalTrack branch)
@ kUseTof
use TRD hits in track refit
@ kRecoTracks
has events reconstructed (CbmEvent branch)
@ kUseTrd
use STS hits in track refit
@ kTofHits
has TRD` hits (TrdHit branch)
std::map< ECbmModuleId, TClonesArray * > fClusters
reconstructed hits
void SetSetupClass(CbmRecoQaTask::eSetup setup)
Define the set of extra z positions where the track should be projected in the x-y plane.
virtual InitStatus Init()
Perform initialization of data sources and projections.
std::map< ECbmModuleId, TClonesArray * > fTracks
reconstructed global tracks / event
bool FilterHit(const CbmHit *h, ECbmModuleId d) const
Filter hit based on internal properties (for the originating sensor \call FilterView())
virtual TrackFilter * AddTrackFilter(ECbmModuleId cut)
TString GetGeoTagForDetector(const TString &detector)
std::vector< TString > GetPath(TGeoNode *node, TString, TString activeNodeName, int depth=0, const TString &path="")
@ kPV
set of track projection views
static constexpr size_t trdSz
static constexpr size_t tofSz
std::map< const char *, View > fViews
list of detector QA
TClonesArray * fTrackMatches
reconstructed global tracks / event
virtual Detector * AddDetector(ECbmModuleId did)
const Data * GetData(ECbmModuleId did, int id) const
Retrieve detector specific data type (Track, Hit, Match) by index.
TDirectoryFile fOutFolder
void InitMcbm22()
build QA plots for particular setups
bool IsActive(eRecoConfig feature)
virtual bool FilterEvent(const CbmEvent *ptr) const
Filter events for QA use (e.g. event multiplicity)
Data class with information on a STS local track.
Bookkeeping of time-slice content.
Class to handle QA-objects in the online reconstruction.
std::vector< Node > fNodes
friend class ::CbmKfTrackFitter
Data(ECbmDataType i, const char *n)
View * GetView(const char *n)
Detector(ECbmModuleId did=ECbmModuleId::kNotExist)
View * FindView(double x, double y, double z)
std::vector< View > fViews
virtual ~Detector()=default
ClassDef(CbmRecoQaTask::Detector, 1)
View * AddView(const char *n, const char *p, std::vector< int > set, bool debug=false)
void HelpMess() const
max no of hits/ev for the systems [STS TRD ToF]
std::string ToString() const
int fMultHit[(int) eEventDef::kNofDetHit]
ClassDef(CbmRecoQaTask::EventFilter, 1)
virtual ~EventFilter()=default
bool SetFilter(std::vector< float > cuts)
bool Accept(const CbmEvent *ptr, const CbmRecoQaTask *lnk)
EventFilter(eEventCut typ=eEventCut::kNone)
@ kNone
cut on vertex definition
@ kVertex
cut on trigger conditions
@ kMultHit
cut on track multiplicity
@ kTrigger
cut on hit multiplicity
std::vector< std::vector< int > > fAccept
std::vector< std::vector< int > > fReject
bool Accept(const CbmHit *h, const CbmCluster *c0=nullptr, const CbmCluster *c1=nullptr) const
friend struct TrackFilter
ClassDef(CbmRecoQaTask::TopoFilter, 1)
list of geo identifiers for each track projection selection
std::vector< std::array< float, projSz > > fRef
list of specific sensors identifiers for each tracking layer of the setup
virtual ~TopoFilter()=default
bool AddCondAccept(std::vector< int > cuts)
Define hit conditions for the analysis. User wrappers.
TrackFilter(ECbmModuleId d=ECbmModuleId::kNotExist)
virtual ~TrackFilter()=default
std::string ToString() const
bool AddTopoCut(std::vector< int > cuts, const char opt)
Define hit conditions for the analysis.
bool AddCondReject(std::vector< int > cuts)
TopoFilter fHitsFilter
definition of min number of hits/track
const std::vector< std::vector< int > > & GetRejectCuts() const
const std::vector< std::vector< int > > & GetAcceptCuts() const
Accessors for the underlying topological cuts definitions.
bool Accept(const CbmGlobalTrack *ptr, const CbmRecoQaTask *lnk) const
bool SetProjFilter(std::vector< float > cuts)
Define geometrical conditions for track acceptance in the analysis.
const TopoFilter * GetHitsFilter() const
const std::vector< std::array< float, projSz > > & GetProjCuts() const
TopoFilter fProjFilter
definition of hits/track topology according to detection unit
ClassDef(CbmRecoQaTask::TrackFilter, 1)
bool AddProjection(eProjectionType prj, float range=-1, const char *unit="cm")
std::string path
name describing the module
std::string makeYrange(const int scale, float &range)
bool Load(const CbmHit *h, const FairMCPoint *point, const CbmEvent *ev)
std::vector< int > fSelector
detection element center x0 y0 z0
friend class CbmRecoQaTask
ClassDef(CbmRecoQaTask::View, 1)
View(const char *n, const char *p, std::vector< int > set)
void SetSetup(CbmRecoQaTask::eSetup setup)
uint Register(TDirectoryFile *f)
build directory structure for all projections of current view.
void SetType(CbmRecoQaTask::eViewType type)
std::string makeTrange(const int scale, float &range)
helper functions to estimate the representation (y) axis
double pos[3]
detection element geometrical dx dy dz dimmensions
bool HasAddress(const CbmHit *h, double &x, double &y, double &dx, double &dy) const
std::map< eProjectionType, std::tuple< int, float, TH1 * > > fProjection
defining subset of the address set for this view
eSetup fSetup
multiplicity between 2 reset signals
double size[3]
path to the geo volume describing the module
bool SetProjection(eProjectionType prj, float range, const char *unit)
std::string ToString() const