Project
Loading...
Searching...
No Matches
AlignPointControl.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13
14#include <TFile.h>
15#include <TTree.h>
16
17#include "Framework/Logger.h"
18
21
22using namespace o2::mft;
23
25
26//__________________________________________________________________________
28 : mControlTree(nullptr),
29 mControlFile(nullptr),
30 mIsSuccessfulInit(false),
31 mNEntriesAutoSave(10000),
32 mOutFileName("mft_align_point.root"),
33 mTreeTitle("align point info tree")
34{
36 mPointInfo.layer = 0;
37 mPointInfo.disk = 0;
38 mPointInfo.half = 0;
57}
58
59//__________________________________________________________________________
61{
62 if (mControlFile) {
63 mControlFile->Close();
64 LOG(info) << "AlignPointControl - closed file "
65 << mOutFileName.Data();
66 delete mControlFile;
67 }
68}
69
70//__________________________________________________________________________
72{
73 if (nEntries <= 0) {
74 return;
75 }
77}
78
79//__________________________________________________________________________
81{
82 mIsSuccessfulInit = true;
83
84 if (mControlFile == nullptr) {
85 mControlFile = new TFile(mOutFileName.Data(), "recreate", "", 505);
86 }
87
88 if (mControlTree == nullptr) {
89 mControlFile->cd();
90 mControlTree = new TTree("point", mTreeTitle.Data());
91 mControlTree->SetAutoSave(mNEntriesAutoSave); // flush the TTree to disk every N entries
92 mControlTree->Branch("sensor", &mPointInfo.sensor, "sensor/s");
93 mControlTree->Branch("layer", &mPointInfo.layer, "layer/s");
94 mControlTree->Branch("disk", &mPointInfo.disk, "disk/s");
95 mControlTree->Branch("half", &mPointInfo.half, "half/s");
96 mControlTree->Branch("measuredGlobalX", &mPointInfo.measuredGlobalX, "measuredGlobalX/D");
97 mControlTree->Branch("measuredGlobalY", &mPointInfo.measuredGlobalY, "measuredGlobalY/D");
98 mControlTree->Branch("measuredGlobalZ", &mPointInfo.measuredGlobalZ, "measuredGlobalZ/D");
99 mControlTree->Branch("measuredLocalX", &mPointInfo.measuredLocalX, "measuredLocalX/D");
100 mControlTree->Branch("measuredLocalY", &mPointInfo.measuredLocalY, "measuredLocalY/D");
101 mControlTree->Branch("measuredLocalZ", &mPointInfo.measuredLocalZ, "measuredLocalZ/D");
102 mControlTree->Branch("residualX", &mPointInfo.residualX, "residualX/D");
103 mControlTree->Branch("residualY", &mPointInfo.residualY, "residualY/D");
104 mControlTree->Branch("residualZ", &mPointInfo.residualZ, "residualZ/D");
105 mControlTree->Branch("residualLocalX", &mPointInfo.residualLocalX, "residualLocalX/D");
106 mControlTree->Branch("residualLocalY", &mPointInfo.residualLocalY, "residualLocalY/D");
107 mControlTree->Branch("residualLocalZ", &mPointInfo.residualLocalZ, "residualLocalZ/D");
108 mControlTree->Branch("recoGlobalX", &mPointInfo.recoGlobalX, "recoGlobalX/D");
109 mControlTree->Branch("recoGlobalY", &mPointInfo.recoGlobalY, "recoGlobalY/D");
110 mControlTree->Branch("recoGlobalZ", &mPointInfo.recoGlobalZ, "recoGlobalZ/D");
111 mControlTree->Branch("recoLocalX", &mPointInfo.recoLocalX, "recoLocalX/D");
112 mControlTree->Branch("recoLocalY", &mPointInfo.recoLocalY, "recoLocalY/D");
113 mControlTree->Branch("recoLocalZ", &mPointInfo.recoLocalZ, "recoLocalZ/D");
114 }
115 if ((!mControlFile) || (mControlFile->IsZombie())) {
116 mIsSuccessfulInit = false;
117 LOG(error) << "AlignPointControl::init() - failed, no viable output file !";
118 }
119 if (!mControlTree) {
120 mIsSuccessfulInit = false;
121 LOG(error) << "AlignPointControl::init() - failed, no TTree !";
122 }
123}
124
125//__________________________________________________________________________
127{
128 if (mControlFile && mControlFile->IsWritable() && mControlTree) {
129 mControlFile->cd();
130 mControlTree->Write();
131 LOG(info) << "AlignPointControl::terminate() - wrote "
132 << mTreeTitle.Data();
133 }
134}
135
136//__________________________________________________________________________
138 const int iTrack,
139 const bool doPrint)
140{
141 if (!isInitOk()) {
142 LOG(warning) << "AlignPointControl::fill() - aborted, init was not ok !";
143 return;
144 }
145
146 bool isPointok = setControlPoint(aPoint);
147
148 if (isPointok) {
149 mControlTree->Fill();
150 if (doPrint) {
151 LOGF(info, "AlignPointControl::fillControlTree() - track %i h %d d %d l %d s %4d lMpos x %.2e y %.2e z %.2e gMpos x %.2e y %.2e z %.2e gRpos x %.2e y %.2e z %.2e",
156 }
157 }
158}
159
160//__________________________________________________________________________
163{
164 if (!aPoint) {
165 LOG(warning) << "AlignPointControl::setControlPoint() - aborted, can not use a null pointer";
166 return false;
167 }
168
169 mPointInfo.sensor = aPoint->getSensorId();
170 mPointInfo.layer = aPoint->layer();
171 mPointInfo.disk = aPoint->disk();
172 mPointInfo.half = aPoint->half();
179 mPointInfo.residualX = aPoint->getGlobalResidual().X();
180 mPointInfo.residualY = aPoint->getGlobalResidual().Y();
181 mPointInfo.residualZ = aPoint->getGlobalResidual().Z();
191
192 return true;
193}
ClassImp(o2::mft::AlignPointControl)
Compute the local and global derivatives at an alignment point (track position, cluster position)
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions false
char error[CURL_ERROR_SIZE]
int32_t nEntries
Definition Objects.cxx:40
void setCyclicAutoSave(const long nEntries)
Set the number of entries to be used by TTree::AutoSave()
AlignPointInfo mPointInfo
information to be written to the output TTree
virtual ~AlignPointControl()
destructor
TTree * mControlTree
the ROOT TTree container
bool setControlPoint(o2::mft::AlignPointHelper *aPoint)
TFile * mControlFile
the output file
TString mTreeTitle
title of the TTree
TString mOutFileName
name of the output file that will store the TTree
void init()
init output file and tree
void fill(o2::mft::AlignPointHelper *aPoint, const int iTrack=0, const bool doPrint=false)
fill the tree from an align point
long mNEntriesAutoSave
max entries in the buffer after which TTree::AutoSave() is automatically used
bool mIsSuccessfulInit
boolean to monitor the success of the initialization
bool isInitOk() const
check if init went well
void terminate()
write tree and close output file
Container of a single alignment point and methods to fill it.
o2::math_utils::Point3D< double > getLocalResidual() const
o2::math_utils::Point3D< double > getGlobalResidual() const
o2::math_utils::Point3D< double > getLocalMeasuredPosition() const
o2::math_utils::Point3D< double > getGlobalRecoPosition() const
o2::math_utils::Point3D< double > getGlobalMeasuredPosition() const
o2::math_utils::Point3D< double > getLocalRecoPosition() const
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"