Project
Loading...
Searching...
No Matches
DCSParserSpec.h
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
41
42#ifndef O2_ITS_DCS_PARSER_SPEC_H
43#define O2_ITS_DCS_PARSER_SPEC_H
44
45#include <string>
46#include <vector>
47#include <iostream>
48#include <fstream>
49
52#include "Framework/Task.h"
54#include <fairmq/Device.h>
55
56#include <ITSMFTReconstruction/RawPixelDecoder.h> //o2::itsmft::RawPixelDecoder
57
59#include "Headers/DataHeader.h"
61#include "CCDB/CcdbObjectInfo.h"
62#include "CCDB/CcdbApi.h"
67
68using namespace o2::framework;
69using namespace o2::itsmft;
70
71namespace o2
72{
73namespace its
74{
75
76// Defining global constants for variables which have not yet been manually set
77const int UNSET_INT = -1111;
78const short int UNSET_SHORT = -1111;
79
80class ITSDCSParser : public Task
81{
82 public:
84 ~ITSDCSParser() override = default;
85
86 void init(InitContext& ic) final;
87 void run(ProcessingContext& pc) final;
88
90 private:
91 // Helper functions
92 void finalizeOutput();
93 void updateMemoryFromInputString(const std::string&);
94 void saveToOutput();
95 void saveMissingToOutput();
96 void resetMemory();
97 void pushToCCDB(ProcessingContext&);
98 bool updatePosition(size_t&, size_t&, const std::string&, const char*, const std::string&, bool ignoreNpos = false);
99 void updateAndCheck(int&, const int);
100 void updateAndCheck(short int&, const short int);
101 void writeChipInfo(const std::string&, const short int);
102 std::vector<std::string> listStaves();
103 void appendDeadChipObj();
104 unsigned short int getModule(unsigned short int chipInMod);
105 bool getHS(unsigned short int chipInMod);
106 unsigned short int getGlobalChipID(unsigned short int hicPos, bool hS, unsigned short int chipInMod);
107
108 std::vector<std::string> vectorizeStringList(const std::string&, const std::string&);
109 std::vector<unsigned short int> vectorizeStringListInt(const std::string&, const std::string&);
110 std::string intVecToStr(const std::vector<unsigned short int>&, const std::string&);
111
112 // Data to be updated in each line of input
113 std::string mStaveName = "";
114 int mRunNumber = UNSET_INT;
115 int mConfigVersion = UNSET_INT;
116 short int mRunType = UNSET_SHORT;
117 std::vector<unsigned short int> mDisabledChips;
118 std::vector<std::vector<unsigned short int>> mMaskedDoubleCols;
119
120 // maps from chip ID to flagged double columns / pixels
121 std::map<unsigned short int, std::vector<unsigned short int>> mDoubleColsDisableEOR;
122 std::map<unsigned short int, std::vector<unsigned short int>> mPixelFlagsEOR;
123
124 std::string mSelfName = "";
125
126 // Whether to use verbose output
127 bool mVerboseOutput = false;
128
129 // Control on string integrity
130 bool mTerminationString = true;
131
132 // DCS config object for storing output string
134
135 // Ccdb url for ccdb upload withing the wf
136 std::string mCcdbUrl = "";
137
138 // Vector containing all the staves listed in the EOR file
139 std::vector<string> mSavedStaves = {};
140
141 // Disabled chip map
142 o2::itsmft::NoiseMap mDeadMap;
143
144 // ITS Map
146
147 // CCDB url for RCT headers
148 std::string mCcdbUrlRct = "http://o2-ccdb.internal";
149};
150
151// Create a processor spec
153
154} // namespace its
155} // namespace o2
156
157#endif
Utils and constants for calibration and related workflows.
A helper class to iteratate over all parts of all input routes.
Definition of the ITSMFT NoiseMap.
Definition of the Alpide pixel reader for raw data processing.
void run(ProcessingContext &pc) final
void init(InitContext &ic) final
~ITSDCSParser() override=default
NoiseMap class for the ITS and MFT.
Definition NoiseMap.h:39
std::vector< char > DCSconfigObject_t
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
o2::framework::DataProcessorSpec getITSDCSParserSpec()
const short int UNSET_SHORT
const int UNSET_INT
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...