CMS 3D CMS Logo

pos::PixelDelay25Calib Class Reference
["Configuration Objects"]

This class manages data and files used in the Delay25 calibration. More...

#include <CalibFormats/SiPixelObjects/interface/PixelDelay25Calib.h>

Inheritance diagram for pos::PixelDelay25Calib:

pos::PixelCalibBase pos::PixelConfigBase

List of all members.

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_


Detailed Description

This class manages data and files used in the Delay25 calibration.

" "

Definition at line 24 of file PixelDelay25Calib.h.


Constructor & Destructor Documentation

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 (  ) 

Definition at line 220 of file PixelDelay25Calib.cc.

00220                                       {
00221 }


Member Function Documentation

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]

Definition at line 49 of file PixelDelay25Calib.h.

References commands_.

00049 {return commands_;}

int pos::PixelDelay25Calib::getGridSize (  )  [inline]

Definition at line 43 of file PixelDelay25Calib.h.

References gridSize_.

00043 {return gridSize_;}

int pos::PixelDelay25Calib::getGridSteps (  )  [inline]

Definition at line 44 of file PixelDelay25Calib.h.

References gridSteps_.

00044 {return gridSteps_;}

int pos::PixelDelay25Calib::getNumberTests (  )  [inline]

Definition at line 45 of file PixelDelay25Calib.h.

References numTests_.

00045 {return numTests_;}

int pos::PixelDelay25Calib::getOrigRDa (  )  [inline]

Definition at line 48 of file PixelDelay25Calib.h.

References origRDa_.

00048 {return origRDa_;}

int pos::PixelDelay25Calib::getOrigSDa (  )  [inline]

Definition at line 47 of file PixelDelay25Calib.h.

References origSDa_.

00047 {return origSDa_;}

int pos::PixelDelay25Calib::getRange (  )  [inline]

Definition at line 46 of file PixelDelay25Calib.h.

References range_.

00046 {return range_;}

virtual std::string pos::PixelDelay25Calib::mode (  )  [inline, virtual]

Definition at line 39 of file PixelDelay25Calib.h.

References mode_.

00039 {return mode_;}

void PixelDelay25Calib::openFiles ( std::string  portcardName,
std::string  moduleName,
std::string  path = "" 
)

Definition at line 223 of file PixelDelay25Calib.cc.

References graph_, and graphout_.

00223                                                                                               {
00224   if (path!="") path+="/";
00225   graph_ = path+"graph_"+portcardName+"_"+moduleName+".dat";
00226   graphout_.open(graph_.c_str());
00227   return;
00228 }

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 }

void PixelDelay25Calib::writeFiles ( int  currentSDa,
int  currentRDa,
int  number 
)

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  ) 

Definition at line 242 of file PixelDelay25Calib.cc.

References lat::endl(), and graphout_.

00242                                                   {
00243   graphout_ << tmp << endl;
00244   return;
00245 }

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]

Reimplemented from pos::PixelConfigBase.

Definition at line 35 of file PixelDelay25Calib.h.

00035 {;}

void pos::PixelDelay25Calib::writeXML ( pos::PixelConfigKey  key,
int  version,
std::string  path 
) const [inline, virtual]

Reimplemented from pos::PixelConfigBase.

Definition at line 33 of file PixelDelay25Calib.h.

00033 {;}

virtual void pos::PixelDelay25Calib::writeXMLHeader ( pos::PixelConfigKey  key,
int  version,
std::string  path,
std::ofstream *  out 
) const [inline, virtual]

Reimplemented from pos::PixelConfigBase.

Definition at line 34 of file PixelDelay25Calib.h.

00034 {;}

virtual void pos::PixelDelay25Calib::writeXMLTrailer ( std::ofstream *  out  )  const [inline, virtual]

Reimplemented from pos::PixelConfigBase.

Definition at line 36 of file PixelDelay25Calib.h.

00036 {;}


Member Data Documentation

bool pos::PixelDelay25Calib::allModules_ [private]

Definition at line 60 of file PixelDelay25Calib.h.

Referenced by allModules().

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]

Definition at line 63 of file PixelDelay25Calib.h.

Referenced by openFiles().

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]

Definition at line 61 of file PixelDelay25Calib.h.

Referenced by getGridSize().

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]

Definition at line 61 of file PixelDelay25Calib.h.

Referenced by getNumberTests().

int pos::PixelDelay25Calib::origRDa_ [private]

Definition at line 61 of file PixelDelay25Calib.h.

Referenced by getOrigRDa().

int pos::PixelDelay25Calib::origSDa_ [private]

Definition at line 61 of file PixelDelay25Calib.h.

Referenced by getOrigSDa().

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]

Definition at line 61 of file PixelDelay25Calib.h.

Referenced by getRange().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:50:34 2009 for CMSSW by  doxygen 1.5.4