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;
152 std::map<
short int,
std::
array<
long int, 6>> mThresholds;
154 std::map<
short int,
std::vector<
int>> mNoisyPixID;
156 std::map<
short int,
std::vector<
int>> mIneffPixID;
158 std::map<
short int,
std::vector<
int>> mDeadPixID;
160 std::map<
short int,
std::
array<
int, 200>> mpvCounter;
162 TFile* mRootOutfile =
nullptr;
163 TTree* mThresholdTree =
nullptr;
164 TTree* mScTree =
nullptr;
165 TTree* mSlopeTree =
nullptr;
166 short int vChipid[N_COL];
167 short int vRow[N_COL];
168 short int vThreshold[N_COL];
169 bool vSuccess[N_COL];
171 unsigned char vPoints[N_COL];
172 short int vMixData[N_COL];
174 float vIntercept[N_COL];
175 unsigned char vCharge[N_COL];
176 unsigned char vHits[N_COL];
177 short int mColStep = 8;
178 short int mRowStep = 1;
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 bool mFlagsRU[N_RU] = {0};
237 std::map<short int, std::map<short int, std::array<std::array<int, 500>, 500>>> mCdwCntRU;
238 short int mLoopVal[N_RU][N_ROW] = {{0}};
239 bool mActiveLinks[N_RU][3] = {{
false}};
240 std::set<short int> mRuSet;
242 char mScanType =
'\0';
243 short int mMin = -1, mMax = -1, mMin2 = 0, mMax2 = 0;
244 short int mStep = 1, mStep2 = 1;
245 short int mStrobeWindow = 5;
246 short int mRowScan = 512;
252 std::string PixelType;
254 std::string mHostname;
264 short int mCdwVersion = 0;
267 bool isEnded =
false;
270 bool mTagSinglePix =
false;
273 std::string mCcdbMgrUrl =
"";
275 bool mCheckExactRow =
false;
279 int mChipModBase = 1;
282 short int inMinVcasn = 30;
283 short int inMaxVcasn = 100;
284 short int inMinIthr = 25;
285 short int inMaxIthr = 100;
291 bool isManualMode =
false;
293 bool scaleNinj =
false;
294 short int manualMin, manualMin2 = 0;
295 short int manualMax, manualMax2 = 0;
296 short int manualStep = 1, manualStep2 = 1;
297 std::string manualScanType;
298 short int manualStrobeWindow = 5;
299 short int manualRowScan = 512;
302 bool isCRUITS =
false;
305 std::vector<int>* mConfDBmap;
309 bool isDumpS =
false;
311 std::string chipDumpS =
"";
312 int dumpCounterS[24120] = {0};
313 bool isChipDB[24120] = {0};
315 std::vector<short int> chipDumpList;
318 bool mRunStopRequested =
false;
321 bool doSlopeCalculation =
false;
322 bool mCalculate2DParams =
true;
330 short int mPercentageCut = 25;
333 short int isLocal =
false;