134 static constexpr
short int N_COL = 1024;
135 static constexpr
short int N_ROW = 512;
140 short int N_RANGE = 51;
142 short int N_RANGE2 = 1;
144 static constexpr
short int N_PIX_DCOL = 50;
150 std::map<
short int,
std::map<
int,
std::vector<
std::vector<
std::vector<
unsigned short int>>>>> mPixelHits;
151 std::map<
short int,
std::deque<
short int>> mForbiddenRows;
153 std::map<
short int,
std::
array<
long int, 6>> mThresholds;
155 std::map<
short int,
std::vector<
int>> mNoisyPixID;
157 std::map<
short int,
std::vector<
int>> mIneffPixID;
159 std::map<
short int,
std::vector<
int>> mDeadPixID;
161 std::map<
short int,
std::
array<
int, 200>> mpvCounter;
163 TFile* mRootOutfile =
nullptr;
164 TTree* mThresholdTree =
nullptr;
165 TTree* mScTree =
nullptr;
166 TTree* mSlopeTree =
nullptr;
167 short int vChipid[N_COL];
168 short int vRow[N_COL];
169 short int vThreshold[N_COL];
170 bool vSuccess[N_COL];
172 unsigned char vPoints[N_COL];
173 short int vMixData[N_COL];
175 float vIntercept[N_COL];
176 unsigned char vCharge[N_COL];
177 unsigned char vHits[N_COL];
178 short int mColStep = 8;
181 TH1F* mFitHist =
nullptr;
182 TF1* mFitFunction =
nullptr;
186 void extractAndUpdate(const
short int&, const
short int&);
187 std::vector<
float> calculatePulseParams(const
short int&);
188 std::vector<
float> calculatePulseParams2D(const
short int&);
189 void extractThresholdRow(const
short int&, const
short int&);
190 void finalizeOutput();
192 void setRunType(const
short int&);
195 void initThresholdTree(
bool recreate = true);
196 bool findUpperLower(
std::vector<
std::vector<
unsigned short int>>, const
short int&,
short int&,
short int&,
bool,
int);
197 bool findThreshold(const
short int&,
std::vector<
std::vector<
unsigned short int>>, const
float*,
short int&,
float&,
float&,
int&,
int);
198 bool findThresholdFit(const
short int&,
std::vector<
std::vector<
unsigned short int>>, const
float*, const
short int&,
float&,
float&,
int&,
int);
199 bool findThresholdDerivative(
std::vector<
std::vector<
unsigned short int>>, const
float*, const
short int&,
float&,
float&,
int&,
int);
200 bool findThresholdHitcounting(
std::vector<
std::vector<
unsigned short int>>, const
float*, const
short int&,
float&,
int);
201 void findAverage(const
std::
array<
long int, 6>&,
float&,
float&,
float&,
float&);
202 void saveThreshold();
205 void addDatabaseEntry(const
short int&, const
char*,
std::vector<
float>,
bool);
208 std::vector<
short int> getIntegerVect(
std::
string&);
209 short int getRUID(
short int chipID);
210 std::vector<
short int> getChipListFromRu(
short int,
bool*);
211 short int getLinkID(
short int,
short int);
212 short int getNumberOfActiveLinks(
bool*);
214 std::
string mSelfName;
215 std::
string mDictName;
216 std::
string mNoiseName;
219 bool mVerboseOutput = false;
220 std::
string mMetaType;
221 std::
string mOutputDir;
222 std::
string mMetafileDir = "/
dev/null";
228 unsigned int mFileNumber = 0;
229 static constexpr unsigned int N_ROWS_PER_FILE = 150000;
230 unsigned int mRowCounter = 0;
232 short int mRunType = -1;
233 short int mRunTypeUp = -1;
234 short int mRunTypeRU[N_RU] = {0};
235 short int mRunTypeRUCopy[N_RU] = {0};
236 short int mCdwCntRU[N_RU][N_ROW] = {{0}};
237 short int mLoopVal[N_RU][N_ROW] = {{0}};
238 bool mActiveLinks[N_RU][3] = {{
false}};
239 std::set<short int> mRuSet;
241 char mScanType =
'\0';
242 short int mMin = -1, mMax = -1, mMin2 = 0, mMax2 = 0;
243 short int mStep = 1, mStep2 = 1;
244 short int mStrobeWindow = 5;
250 std::string PixelType;
252 std::string mHostname;
262 short int mCdwVersion = 0;
265 bool isEnded =
false;
268 bool mTagSinglePix =
false;
271 std::string mCcdbMgrUrl =
"";
273 bool mCheckExactRow =
false;
277 int mChipModBase = 1;
280 short int inMinVcasn = 30;
281 short int inMaxVcasn = 100;
282 short int inMinIthr = 25;
283 short int inMaxIthr = 100;
289 bool isManualMode =
false;
291 bool scaleNinj =
false;
292 short int manualMin, manualMin2 = 0;
293 short int manualMax, manualMax2 = 0;
294 short int manualStep = 1, manualStep2 = 1;
295 std::string manualScanType;
296 short int manualStrobeWindow = 5;
299 bool isCRUITS =
false;
302 std::vector<int>* mConfDBmap;
306 bool isDumpS =
false;
308 std::string chipDumpS =
"";
309 int dumpCounterS[24120] = {0};
310 int countCdw[24120] = {0};
312 std::vector<short int> chipDumpList;
315 bool mRunStopRequested =
false;
318 bool doSlopeCalculation =
false;
319 bool mCalculate2DParams =
true;
327 short int mPercentageCut = 25;