Commit aad88ae7 authored by Daniel Hynds's avatar Daniel Hynds
Browse files

added DUT pixel masking


Former-commit-id: 9b0f971f22ba74df189347ef530a788d7ec9606b
parent 002ea317
......@@ -8,6 +8,7 @@ Parameters::Parameters(){
histogramFile = "outputHistograms.root";
conditionsFile = "cond.dat";
dutMaskFile = "defaultMask.dat";
inputDirectory = "";
nEvents = 0;
align = false;
......@@ -126,7 +127,6 @@ bool Parameters::writeConditions(){
}
bool Parameters::readConditions(){
// Open the conditions file to read detector information
......@@ -184,4 +184,41 @@ bool Parameters::readConditions(){
}
void Parameters::readDutMask() {
// If no masked file set, do nothing
if(dutMaskFile == "defaultMask.dat") return;
detector[this->DUT]->setMaskFile(dutMaskFile);
// Open the file with masked pixels
std::fstream inputMaskFile(dutMaskFile.c_str(), std::ios::in);
int row,col; std::string id;
std::string line;
// loop over all lines and apply masks
while(getline(inputMaskFile,line)){
inputMaskFile >> id >> row >> col;
if(id == "c") maskDutColumn(col); // Flag to mask a column
if(id == "r") maskDutRow(row); // Flag to mask a row
if(id == "p") detector[this->DUT]->maskChannel(col,row); // Flag to mask a pixel
}
return;
}
// The masking of pixels on the dut uses a map with unique
// id for each pixel given by column + row*numberColumns
void Parameters::maskDutColumn(int column){
int nRows = detector[this->DUT]->nPixelsY();
for(int row=0;row<nRows;row++) detector[this->DUT]->maskChannel(column,row);
}
void Parameters::maskDutRow(int row){
int nColumns = detector[this->DUT]->nPixelsX();
for(int column=0;column<nColumns;column++) detector[this->DUT]->maskChannel(column,row);
}
#ifndef PARAMETERS_H
#ifndef PARAMETERS_H
#define PARAMETERS_H 1
// Include files
......@@ -217,17 +217,21 @@ public:
bool readConditions();
bool writeConditions();
void readCommandLineOptions(int, char**);
void readDutMask();
void maskDutColumn(int);
void maskDutRow(int);
void registerDetector(string detectorID){
nDetectors++;
detectors.push_back(detectorID);
}
// Member variables
string conditionsFile;
string inputTupleFile;
string inputDirectory;
string outputTupleFile;
string histogramFile;
string dutMaskFile;
vector<string> detectors;
int nDetectors;
string reference;
......
......@@ -81,8 +81,12 @@ int main(int argc, char *argv[]) {
// =========================================================================
// General parameters
parameters->reference = "Mim-osa02";
parameters->DUT = "CLi-CPix";
// parameters->reference = "Mim-osa02";
// parameters->DUT = "CLi-CPix";
parameters->reference = "W0013_G03";
// parameters->DUT = "W0019_L08";
parameters->DUT = "W0019_F07";
parameters->detectorToAlign = parameters->DUT;
parameters->excludedFromTracking[parameters->DUT] = true;
......@@ -93,7 +97,7 @@ int main(int argc, char *argv[]) {
parameters->excludedFromTracking["W0019_F07"] = true;
parameters->excludedFromTracking["W0019_L08"] = true;
parameters->excludedFromTracking["W0005_H03"] = true;
// =========================================================================
// Steering file ends
// =========================================================================
......@@ -104,20 +108,23 @@ int main(int argc, char *argv[]) {
// Load alignment parameters
if(!parameters->readConditions()) return 0;
// Load mask file for the dut (if specified)
parameters->readDutMask();
// Initialise the analysis object and add algorithms to run
analysis = new Analysis(parameters);
analysis->add(tpix1EventLoader);
// analysis->add(fileReader);
// analysis->add(tpix1Clustering);
// analysis->add(spatialTracking);
// analysis->add(correlator);
// analysis->add(tpix1EventLoader);
analysis->add(fileReader);
analysis->add(tpix1Clustering);
analysis->add(spatialTracking);
analysis->add(correlator);
// analysis->add(tpix3EventLoader);
// analysis->add(tpix3Clustering);
// analysis->add(testAlgorithm);
// analysis->add(basicTracking);
// analysis->add(dutAnalysis);
// analysis->add(clicpixAnalysis);
analysis->add(fileWriter);
analysis->add(clicpixAnalysis);
// analysis->add(fileWriter);
if(parameters->align) analysis->add(alignment);
if(parameters->produceMask) analysis->add(tpix3MaskCreator);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment