Project
Loading...
Searching...
No Matches
ITSTPCMatchingQCSpec.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
16#include "Framework/Logger.h"
24#include <TFile.h>
25
26using namespace o2::framework;
27
28namespace o2
29{
30namespace globaltracking
31{
32
34{
36
37 mMatchITSTPCQC = std::make_unique<o2::gloqc::MatchITSTPCQC>();
38 mMatchITSTPCQC->setDataRequest(mDataRequest);
39 mMatchITSTPCQC->setTrkSources(o2::dataformats::GlobalTrackID::getSourcesMask(mTrkSources));
40 mMatchITSTPCQC->setMinPtITSCut(params.minPtITSCut);
41 mMatchITSTPCQC->setEtaITSCut(params.etaITSCut);
42 mMatchITSTPCQC->setMinNClustersITS(params.minNITSClustersCut);
43 mMatchITSTPCQC->setMaxChi2PerClusterITS(params.maxChi2PerClusterITS);
44 mMatchITSTPCQC->setMinPtTPCCut(params.minPtTPCCut);
45 mMatchITSTPCQC->setEtaTPCCut(params.etaTPCCut);
46 mMatchITSTPCQC->setMinNTPCClustersCut(params.minNTPCClustersCut);
47 mMatchITSTPCQC->setMinDCAtoBeamPipeDistanceCut(params.minDCACut);
48 mMatchITSTPCQC->setMinDCAtoBeamPipeYCut(params.minDCACutY);
49 mMatchITSTPCQC->setPtCut(params.minPtCut);
50 mMatchITSTPCQC->setMaxPtCut(params.maxPtCut);
51 mMatchITSTPCQC->setEtaCut(params.etaCut);
52 mMatchITSTPCQC->setEtaNo0Cut(params.etaNo0Cut);
53 mMatchITSTPCQC->setCutK0Mass(params.cutK0Mass);
54 mMatchITSTPCQC->setMaxK0Eta(params.maxEtaK0);
55 mMatchITSTPCQC->setK0Scaling(params.K0Scaling);
56 mMatchITSTPCQC->setMinTPCOccpp(params.minTPCOccpp);
57 mMatchITSTPCQC->setMaxTPCOccpp(params.maxTPCOccpp);
58 mMatchITSTPCQC->setNBinsTPCOccpp(params.nBinsTPCOccpp);
59 mMatchITSTPCQC->setMinTPCOccPbPb(params.minTPCOccPbPb);
60 mMatchITSTPCQC->setMaxTPCOccPbPb(params.maxTPCOccPbPb);
61 mMatchITSTPCQC->setNBinsTPCOccPbPb(params.nBinsTPCOccPbPb);
62 mMatchITSTPCQC->setK0MaxDCA(params.maxK0DCA);
63 mMatchITSTPCQC->setK0MinCosPA(params.minK0CosPA);
65 if (mUseMC) {
66 mMatchITSTPCQC->setUseMC(mUseMC);
67 }
68 if (mDoK0QC) {
69 mMatchITSTPCQC->setDoK0QC(mDoK0QC);
70 }
71 mMatchITSTPCQC->init();
72}
73
74//_____________________________________________________________
75
77{
79 static bool wasSVParamInitialized = false;
80 if (!wasSVParamInitialized) {
82 wasSVParamInitialized = true;
83 }
84 mMatchITSTPCQC->run(pc);
85}
86
87//_____________________________________________________________
88
90{
91
92 mMatchITSTPCQC->finalize();
93 sendOutput(ec.outputs());
94}
95
96//_____________________________________________________________
97
98void ITSTPCMatchingQCDevice::sendOutput(DataAllocator& output)
99{
100
101 TObjArray objar;
102 mMatchITSTPCQC->getHistos(objar);
103 output.snapshot(Output{"GLO", "ITSTPCMATCHQC", 0}, objar);
104
105 TFile* f = new TFile(Form("outITSTPCmatchingQC.root"), "RECREATE");
106 if (f == nullptr) {
107 LOGP(error, "Cannot write QC to file 'outITSTPCmatchingQC.root'");
108 return;
109 }
110 objar.Write("ObjArray", TObject::kSingleKey);
111 f->Close();
112}
113
115{
117 return;
118 }
119 if (matcher == ConcreteDataMatcher("GLO", "SVPARAM", 0)) {
120 return;
121 }
122}
123} // namespace globaltracking
124
125namespace framework
126{
128
129DataProcessorSpec getITSTPCMatchingQCDevice(bool useMC, bool doK0QC, std::string trkSources)
130{
131 std::vector<OutputSpec> outputs;
132 outputs.emplace_back("GLO", "ITSTPCMATCHQC", 0, Lifetime::Sporadic);
133
134 auto dataRequest = std::make_shared<o2::globaltracking::DataRequest>();
135 GID::mask_t srcMask = GID::getSourcesMask(trkSources);
136 dataRequest->requestTracks(srcMask, useMC);
137 if (doK0QC) {
138 dataRequest->requestPrimaryVertices(useMC);
139 dataRequest->requestSecondaryVertices(useMC);
140 dataRequest->requestTPCClusters(false);
141 }
142 auto ccdbRequest = std::make_shared<o2::base::GRPGeomRequest>(false, // orbitResetTime
143 true, // GRPECS=true
144 true, // GRPLHCIF
145 true, // GRPMagField
146 false, // askMatLUT
148 dataRequest->inputs);
149
150 dataRequest->inputs.emplace_back("SVParam", "GLO", "SVPARAM", 0, Lifetime::Condition, ccdbParamSpec("GLO/Config/SVertexerParam"));
151 return DataProcessorSpec{
152 .name = "itstpc-matching-qc",
153 .inputs = dataRequest->inputs,
154 .outputs = outputs,
155 .algorithm = AlgorithmSpec{adaptFromTask<o2::globaltracking::ITSTPCMatchingQCDevice>(dataRequest, ccdbRequest, useMC, doK0QC, trkSources)},
156 };
157}
158
159} // namespace framework
160} // namespace o2
Wrapper container for different reconstructed object types.
void output(const std::map< std::string, ChannelStat > &channels)
Definition rawdump.cxx:197
Definition of the Names Generator class.
Configurable params for secondary vertexer.
void checkUpdates(o2::framework::ProcessingContext &pc)
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
static mask_t getSourcesMask(const std::string_view srcList)
decltype(auto) get(R binding, int part=0) const
InputRecord & inputs()
The inputs associated with this processing context.
void init(o2::framework::InitContext &ic) final
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void run(o2::framework::ProcessingContext &pc) final
void finaliseCCDB(ConcreteDataMatcher &matcher, void *obj) final
GLdouble f
Definition glcorearb.h:310
GLenum const GLfloat * params
Definition glcorearb.h:272
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...