#include <CalibFormats/SiPixelObjects/interface/PixelDelay25Calib.h>
Public Member Functions | |
bool | allModules () |
bool | allPortcards () |
void | closeFiles () |
int | getCommands () |
int | getGridSize () |
int | getGridSteps () |
int | getNumberTests () |
int | getOrigRDa () |
int | getOrigSDa () |
int | getRange () |
virtual std::string | mode () |
void | openFiles (std::string portcardName, std::string moduleName, std::string path="") |
PixelDelay25Calib (std::vector< std::vector< std::string > > &) | |
PixelDelay25Calib (std::string) | |
std::set< std::string > & | portcardList () |
virtual void | writeASCII (std::string dir="") const |
void | writeFiles (int currentSDa, int currentRDa, int number) |
void | writeFiles (std::string tmp) |
void | writeSettings (std::string portcardName, std::string moduleName) |
virtual void | writeXML (std::ofstream *out) const |
void | writeXML (pos::PixelConfigKey key, int version, std::string path) const |
virtual void | writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const |
virtual void | writeXMLTrailer (std::ofstream *out) const |
~PixelDelay25Calib () | |
Private Attributes | |
bool | allModules_ |
bool | allPortcards_ |
int | commands_ |
std::string | graph_ |
std::ofstream | graphout_ |
int | gridSize_ |
int | gridSteps_ |
std::string | mode_ |
int | numTests_ |
int | origRDa_ |
int | origSDa_ |
std::set< std::string > | portcardNames_ |
int | range_ |
" "
Definition at line 24 of file PixelDelay25Calib.h.
PixelDelay25Calib::PixelDelay25Calib | ( | std::string | filename | ) |
Definition at line 137 of file PixelDelay25Calib.cc.
References allPortcards_, commands_, GenMuonPlsPt100GeV_cfg::cout, gridSteps_, in, and portcardNames_.
00137 : 00138 PixelCalibBase(), 00139 PixelConfigBase("","",""){ 00140 00141 std::cout<<"PixelDelay25Calib::PixelDelay25Calib"<<std::endl; 00142 00143 std::ifstream in(filename.c_str()); 00144 00145 if(!in.good()){ 00146 std::cout<<"Could not open: "<<filename<<std::endl; 00147 assert(0); 00148 } 00149 else { 00150 std::cout<<"Opened: "<<filename<<std::endl; 00151 } 00152 00153 //Read initial SDa and RDa values, ranges, 00154 //and grid step size from file 00155 00156 std::string tmp; 00157 00158 in >> tmp; 00159 00160 assert(tmp=="Mode:"); 00161 in >> mode_; 00162 00163 in >> tmp; 00164 00165 assert(tmp=="Portcards:"); 00166 in >> tmp; 00167 if(tmp=="All") 00168 { 00169 allPortcards_ = true; 00170 } else { 00171 allPortcards_ = false; 00172 } 00173 while (tmp!="AllModules:") 00174 { 00175 portcardNames_.insert(tmp); 00176 in >> tmp; 00177 } 00178 00179 assert(tmp=="AllModules:"); 00180 in >> allModules_; 00181 00182 in >> tmp; 00183 00184 assert(tmp=="OrigSDa:"); 00185 in >> origSDa_; 00186 00187 in >> tmp; 00188 00189 assert(tmp=="OrigRDa:"); 00190 in >> origRDa_; 00191 00192 in >> tmp; 00193 00194 assert(tmp=="Range:"); 00195 in >> range_; 00196 00197 in >> tmp; 00198 00199 assert(tmp=="GridSize:"); 00200 in >> gridSize_; 00201 00202 in >> tmp; 00203 assert(tmp=="Tests:"); 00204 in >> numTests_; 00205 00206 in >> tmp; 00207 if(tmp=="Commands:") { 00208 in >> commands_; 00209 } else { 00210 commands_=0; 00211 } 00212 00213 in.close(); 00214 00215 //Number of steps in the grid 00216 gridSteps_ = range_/gridSize_; 00217 00218 }
pos::PixelDelay25Calib::PixelDelay25Calib | ( | std::vector< std::vector< std::string > > & | ) |
PixelDelay25Calib::~PixelDelay25Calib | ( | ) |
bool pos::PixelDelay25Calib::allModules | ( | ) | [inline] |
Definition at line 42 of file PixelDelay25Calib.h.
References allModules_.
00042 {return allModules_;}
bool pos::PixelDelay25Calib::allPortcards | ( | ) | [inline] |
Definition at line 41 of file PixelDelay25Calib.h.
References allPortcards_.
00041 {return allPortcards_;}
void PixelDelay25Calib::closeFiles | ( | ) |
Definition at line 252 of file PixelDelay25Calib.cc.
References graphout_.
00252 { 00253 graphout_.close(); 00254 return; 00255 }
int pos::PixelDelay25Calib::getCommands | ( | ) | [inline] |
int pos::PixelDelay25Calib::getGridSize | ( | ) | [inline] |
int pos::PixelDelay25Calib::getGridSteps | ( | ) | [inline] |
Definition at line 44 of file PixelDelay25Calib.h.
References gridSteps_.
00044 {return gridSteps_;}
int pos::PixelDelay25Calib::getNumberTests | ( | ) | [inline] |
int pos::PixelDelay25Calib::getOrigRDa | ( | ) | [inline] |
int pos::PixelDelay25Calib::getOrigSDa | ( | ) | [inline] |
int pos::PixelDelay25Calib::getRange | ( | ) | [inline] |
virtual std::string pos::PixelDelay25Calib::mode | ( | ) | [inline, virtual] |
void PixelDelay25Calib::openFiles | ( | std::string | portcardName, | |
std::string | moduleName, | |||
std::string | path = "" | |||
) |
std::set<std::string>& pos::PixelDelay25Calib::portcardList | ( | ) | [inline] |
Definition at line 40 of file PixelDelay25Calib.h.
References portcardNames_.
00040 {return portcardNames_;}
void PixelDelay25Calib::writeASCII | ( | std::string | dir = "" |
) | const [virtual] |
Implements pos::PixelConfigBase.
Definition at line 257 of file PixelDelay25Calib.cc.
References commands_, lat::endl(), EgammaValidation_cff::filename, i, out, and portcardNames_.
00257 { 00258 00259 00260 //FIXME this is not tested for all the use cases... 00261 00262 if (dir!="") dir+="/"; 00263 std::string filename=dir+"delay25.dat"; 00264 std::ofstream out(filename.c_str()); 00265 00266 out << "Mode: "<<mode_<<endl; 00267 00268 out << "Portcards:" <<endl; 00269 00270 std::set<std::string>::const_iterator i=portcardNames_.begin(); 00271 while (i!=portcardNames_.end()) { 00272 out << *i << endl; 00273 ++i; 00274 } 00275 00276 out << "AllModules:" <<endl; 00277 if (allModules_) { 00278 out << "1" <<endl; 00279 } else { 00280 out << "0" <<endl; 00281 } 00282 00283 out << "OrigSDa:"<<endl; 00284 out << origSDa_<<endl; 00285 00286 out << "OrigRDa:"<<endl; 00287 out << origRDa_<<endl; 00288 00289 out << "Range:"<<endl; 00290 out << range_<<endl; 00291 00292 out << "GridSize:"<<endl; 00293 out << gridSize_<<endl; 00294 00295 out << "Tests:"<<endl; 00296 out << numTests_<<endl; 00297 00298 out << "Commands:"<<endl; 00299 out << commands_<<endl; 00300 00301 out.close(); 00302 }
Definition at line 247 of file PixelDelay25Calib.cc.
References lat::endl(), and graphout_.
00247 { 00248 graphout_ << currentSDa << " " << currentRDa << " " << number << endl; 00249 return; 00250 }
void PixelDelay25Calib::writeFiles | ( | std::string | tmp | ) |
void PixelDelay25Calib::writeSettings | ( | std::string | portcardName, | |
std::string | moduleName | |||
) |
Definition at line 230 of file PixelDelay25Calib.cc.
References lat::endl(), and graphout_.
00230 { 00231 graphout_ << "Portcard: " << portcardName << endl; 00232 graphout_ << "Module: " << moduleName << endl; 00233 graphout_ << "SDaOrigin: " << origSDa_ << endl; 00234 graphout_ << "RDaOrigin: " << origRDa_ << endl; 00235 graphout_ << "SDaRange: " << range_ << endl; 00236 graphout_ << "RDaRange: " << range_ << endl; 00237 graphout_ << "GridSize: " << gridSize_ << endl; 00238 graphout_ << "Tests: " << numTests_ << endl; 00239 return; 00240 }
virtual void pos::PixelDelay25Calib::writeXML | ( | std::ofstream * | out | ) | const [inline, virtual] |
void pos::PixelDelay25Calib::writeXML | ( | pos::PixelConfigKey | key, | |
int | version, | |||
std::string | path | |||
) | const [inline, virtual] |
virtual void pos::PixelDelay25Calib::writeXMLHeader | ( | pos::PixelConfigKey | key, | |
int | version, | |||
std::string | path, | |||
std::ofstream * | out | |||
) | const [inline, virtual] |
virtual void pos::PixelDelay25Calib::writeXMLTrailer | ( | std::ofstream * | out | ) | const [inline, virtual] |
bool pos::PixelDelay25Calib::allModules_ [private] |
bool pos::PixelDelay25Calib::allPortcards_ [private] |
Definition at line 60 of file PixelDelay25Calib.h.
Referenced by allPortcards(), and PixelDelay25Calib().
int pos::PixelDelay25Calib::commands_ [private] |
Definition at line 61 of file PixelDelay25Calib.h.
Referenced by getCommands(), PixelDelay25Calib(), and writeASCII().
std::string pos::PixelDelay25Calib::graph_ [private] |
std::ofstream pos::PixelDelay25Calib::graphout_ [private] |
Definition at line 62 of file PixelDelay25Calib.h.
Referenced by closeFiles(), openFiles(), writeFiles(), and writeSettings().
int pos::PixelDelay25Calib::gridSize_ [private] |
int pos::PixelDelay25Calib::gridSteps_ [private] |
Definition at line 61 of file PixelDelay25Calib.h.
Referenced by getGridSteps(), and PixelDelay25Calib().
std::string pos::PixelDelay25Calib::mode_ [private] |
Reimplemented from pos::PixelCalibBase.
Definition at line 58 of file PixelDelay25Calib.h.
Referenced by mode().
int pos::PixelDelay25Calib::numTests_ [private] |
int pos::PixelDelay25Calib::origRDa_ [private] |
int pos::PixelDelay25Calib::origSDa_ [private] |
std::set<std::string> pos::PixelDelay25Calib::portcardNames_ [private] |
Definition at line 59 of file PixelDelay25Calib.h.
Referenced by PixelDelay25Calib(), portcardList(), and writeASCII().
int pos::PixelDelay25Calib::range_ [private] |