TreeDedxCalibDataCnv Class Reference

#include <TreeDedxCalibDataCnv.h>

Inheritance diagram for TreeDedxCalibDataCnv:

TreeCalBaseCnv Converter< Ty1, Ty2 > List of all members.

Public Types

typedef Ty1 source
typedef Ty2 destination

Public Member Functions

const CLID & objType () const
 TreeDedxCalibDataCnv (ISvcLocator *svc)
virtual ~TreeDedxCalibDataCnv ()
virtual long repSvcType () const
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&refpObject)
ICalibTreeSvcgetCalibTreeSvc ()
virtual StatusCode createRoot (const std::string &fname, CalibData::CalibBase1 *pTDSObj)
destinationoperator (const source &) const

Static Public Member Functions

static const CLID & classID ()
static const unsigned char storageType ()

Protected Member Functions

virtual StatusCode i_createObj (IOpaqueAddress *address, DataObject *&refpObject)
virtual StatusCode internalCreateObj (DataObject *&refpObject, IOpaqueAddress *address)
virtual StatusCode i_processObj (DataObject *pObject, IOpaqueAddress *address)
 In case there is additional work to do on the created object.
virtual StatusCode fillRoot (CalibData::CalibBase *pTDSObj, TObject *pRootObj)
void setBaseInfo (CalibData::CalibBase1 *pObj)
 Another utility for derived classes to use.
virtual destinationconvert (const source &) const =0

Protected Attributes

ICalibTreeSvcm_treeSvc
ICalibMetaCnvSvcm_metaSvc
IInstrumentNamem_instrSvc
int m_serNo
int m_runfrm
int m_runto
TFile * m_outFile
TTree * m_ttree
TFile * m_inFile
TDirectory * m_saveDir

Friends

class CnvFactory< TreeDedxCalibDataCnv >

Detailed Description

Base class for CAL calibration converters from Ttrees to TCDS. All such converters need to do certain things, which are handled here. Methods common to *all* calibrations are in the base class TreeCalBaseCnv

Author:
huang bin

Definition at line 20 of file TreeDedxCalibDataCnv.h.


Member Typedef Documentation

template<class Ty1, class Ty2>
typedef Ty2 Converter< Ty1, Ty2 >::destination [inherited]

Definition at line 19 of file Converter.h.

template<class Ty1, class Ty2>
typedef Ty1 Converter< Ty1, Ty2 >::source [inherited]

Definition at line 18 of file Converter.h.


Constructor & Destructor Documentation

TreeDedxCalibDataCnv::TreeDedxCalibDataCnv ( ISvcLocator *  svc  ) 

Definition at line 32 of file TreeDedxCalibDataCnv.cxx.

00032                                                             :
00033   TreeCalBaseCnv(svc, CLID_Calib_DedxCal) { 
00034 
00035 }

virtual TreeDedxCalibDataCnv::~TreeDedxCalibDataCnv (  )  [inline, virtual]

Definition at line 29 of file TreeDedxCalibDataCnv.h.

00029 {};


Member Function Documentation

const CLID & TreeDedxCalibDataCnv::classID (  )  [static]

Definition at line 42 of file TreeDedxCalibDataCnv.cxx.

References CLID_Calib_DedxCal.

00042                                           {
00043   return CLID_Calib_DedxCal;
00044 }

template<class Ty1, class Ty2>
virtual destination* Converter< Ty1, Ty2 >::convert ( const source  )  const [protected, pure virtual, inherited]

StatusCode TreeCalBaseCnv::createObj ( IOpaqueAddress *  addr,
DataObject *&  refpObject 
) [virtual, inherited]

Create the transient representation of an object, given an opaque address. This and the following update method comprise the core functionality of calibration converters.

Definition at line 111 of file TreeCalBaseCnv.cxx.

References Bes_Common::DEBUG, TreeCalBaseCnv::internalCreateObj(), and msgSvc().

00112                                                            {
00113   //  StatusCode ret;
00114 
00115   // first do the things we always need:
00116   //   First string parameter of opaque address is file ident
00117   MsgStream log(msgSvc(), "TreeCalBaseCnv");
00118    log << MSG::DEBUG<<"TreeCalBaseCnv::createObj( starting ...."<<endreq;
00119  //  const std::string* par = addr->par();
00120 
00121  // std::string par0 = par[0];
00122    
00123 //  return internalCreateObj(par0, refpObject, addr);
00124   return internalCreateObj(refpObject, addr);
00125 
00126 }

StatusCode TreeCalBaseCnv::createRoot ( const std::string fname,
CalibData::CalibBase1 pTDSObj 
) [virtual, inherited]

Create ROOT file corresponding to TDS object input. Default implementation is to return an error. Must be separately implemented for each calibration type.

Parameters:
fname Filename for output file
pTDSObj Pointer to tds object to be converted

Definition at line 89 of file TreeCalBaseCnv.cxx.

References calibUtil::ERROR, and msgSvc().

00090                                                                        {
00091   MsgStream log(msgSvc(), "TreeCalBaseCnv");
00092   log << MSG::ERROR 
00093       << "createRoot method not implemented for this calibration type" 
00094       << endreq;
00095   return StatusCode::FAILURE;
00096 }

StatusCode TreeCalBaseCnv::fillRoot ( CalibData::CalibBase pTDSObj,
TObject *  pRootObj 
) [protected, virtual, inherited]

Given a pointer to a TDS object which can be cast to "our" type, fill in corresponding information in the corresponding root class

Parameters:
pTDSObj Pointer to tds object to be converted
pRootObj Pointer to destination root object
...maybe don't need pRootObj argument; keep this as the (protected) data member m_rootObj. Or else this routine could set the protected member to this passed-in value

Definition at line 100 of file TreeCalBaseCnv.cxx.

00101                                                           {
00102 
00103   // Get instrument name from InstrumentName service  Now handled by 
00104   // TreeCalBaseCnv
00105   //  TString instr = TString((m_instrSvc->getInstrumentName()).c_str());
00106   //  pRootObj->setInstrument(instr);
00107   return StatusCode::SUCCESS;
00108 }

StatusCode TreeCalBaseCnv::finalize (  )  [virtual, inherited]

Definition at line 82 of file TreeCalBaseCnv.cxx.

00082                                     {
00083   return Converter::finalize();
00084 }

ICalibTreeSvc* TreeCalBaseCnv::getCalibTreeSvc (  )  [inline, inherited]

Definition at line 58 of file TreeCalBaseCnv.h.

References TreeCalBaseCnv::m_treeSvc.

00058                                    {
00059     return m_treeSvc;
00060   }

StatusCode TreeDedxCalibDataCnv::i_createObj ( IOpaqueAddress *  address,
DataObject *&  refpObject 
) [protected, virtual]

This creates the transient representation of an object from the corresponding ROOT object. This actually does the "new" operation and deals with the attributes of the node. This base class implementation does nothing; it should not normally be called because it doesn't correspond to any TCDS class. Instead, i_createObj of some derived class will be called.

Parameters:
fname The ROOT file to be read in to be used to builds the object
refpObject the object to be built
Returns:
status depending on the completion of the call

Reimplemented from TreeCalBaseCnv.

Definition at line 46 of file TreeDedxCalibDataCnv.cxx.

References Bes_Common::DEBUG, Bes_Common::FATAL, genRecEmupikp::i, msgSvc(), TrigConf::N, TreeAddress::pp(), check_raw_filter::runno, CalibData::DedxCalibData::set_costheta(), CalibData::DedxCalibData::set_dedx(), CalibData::DedxCalibData::set_hadron(), CalibData::DedxCalibData::set_hadronNo(), and CalibData::DedxCalibData::set_t0().

00047                                                                 {
00048 
00049   MsgStream log(msgSvc(), "TreeDedxCalibDataCnv");
00050   log<<MSG::DEBUG<<"SetProperty"<<endreq;
00051 
00052   CalibData::DedxCalibData *tmpObject = new CalibData::DedxCalibData;
00053  TreeAddress* add = dynamic_cast<TreeAddress*>(addr);
00054   DatabaseRecord *records=add->pp();
00055 
00056  /*TBuffer *buf1 = new TBuffer(TBuffer::kRead);
00057  TBuffer *buf2 = new TBuffer(TBuffer::kRead);
00058  TBuffer *buf3 = new TBuffer(TBuffer::kRead);
00059  TBuffer *buf4 = new TBuffer(TBuffer::kRead);
00060  TBuffer *buf5 = new TBuffer(TBuffer::kRead);
00061  TBuffer *buf6 = new TBuffer(TBuffer::kRead);
00062  TBuffer *buf7 = new TBuffer(TBuffer::kRead);
00063  TBuffer *buf8 = new TBuffer(TBuffer::kRead);
00064  TBuffer *buf9 = new TBuffer(TBuffer::kRead);*/
00065  
00066 TBufferFile *buf1 = new TBufferFile(TBuffer::kRead);
00067  TBufferFile *buf2 = new TBufferFile(TBuffer::kRead);
00068  TBufferFile *buf3 = new TBufferFile(TBuffer::kRead);
00069  TBufferFile *buf4 = new TBufferFile(TBuffer::kRead);
00070  TBufferFile *buf5 = new TBufferFile(TBuffer::kRead);
00071  TBufferFile *buf6 = new TBufferFile(TBuffer::kRead);
00072  TBufferFile *buf7 = new TBufferFile(TBuffer::kRead);
00073  TBufferFile *buf8 = new TBufferFile(TBuffer::kRead);
00074  TBufferFile *buf9 = new TBufferFile(TBuffer::kRead);
00075 
00076  buf1->SetBuffer((*records)["DriftDist"],512000,kFALSE);
00077  buf2->SetBuffer((*records)["EntranceAng"],512000,kFALSE);
00078  buf3->SetBuffer((*records)["MeanGain"],512000,kFALSE);
00079  buf4->SetBuffer((*records)["GasGain"],512000,kFALSE);
00080  buf5->SetBuffer((*records)["LayerGain"],512000,kFALSE);
00081  buf6->SetBuffer((*records)["Resolution"],512000,kFALSE);
00082  buf7->SetBuffer((*records)["WireGain"],512000,kFALSE);
00083  buf8->SetBuffer((*records)["ZDep"],512000,kFALSE);
00084  buf9->SetBuffer((*records)["RunGain"],512000,kFALSE);
00085 
00086 
00087 
00088  std::cout<<" SftVer is "<<(*records)["SftVer"];
00089  std::cout<<" CalVerSft is "<<(*records)["CalParVer"];
00090  std::cout<<"  File name  is "<<(*records)["FileName"]<<std::endl;
00091 
00092 
00093 
00094   TTree* ddgtree = new TTree(); 
00095   ddgtree->Streamer(*buf1); 
00096  
00097   TTree* entratree = new TTree(); 
00098   entratree->Streamer(*buf2);
00099 
00100   TTree* gaintree= new TTree(); 
00101   gaintree->Streamer(*buf3); 
00102 
00103   TTree* ggstree = new TTree(); 
00104   ggstree->Streamer(*buf4); 
00105 
00106   TTree* layergtree = new TTree(); 
00107   layergtree->Streamer(*buf5); 
00108 
00109   TTree* resoltree = new TTree(); 
00110   resoltree->Streamer(*buf6); 
00111 
00112   TTree* wiregtree = new TTree(); 
00113   wiregtree->Streamer(*buf7); 
00114 
00115   TTree* zdeptree = new TTree(); 
00116   zdeptree->Streamer(*buf8); 
00117 
00118   TTree *rungtree = new TTree();
00119   rungtree->Streamer(*buf9);
00120 
00121   double rungain;
00122   double runmean;
00123   int runno;
00124   double runresol;
00125 
00126   rungtree -> SetBranchAddress("rungain", &rungain);
00127   rungtree -> SetBranchAddress("runmean", &runmean);
00128   rungtree -> SetBranchAddress("runno", &runno);
00129   rungtree -> SetBranchAddress("runresol", &runresol);
00130   int N = rungtree -> GetEntries();
00131   tmpObject -> setrunNO(N);
00132   for(int i=0; i<N; i++){
00133        rungtree -> GetEntry(i);
00134        tmpObject -> setrung(rungain,0,i);
00135        tmpObject -> setrung(runmean,1,i);
00136        tmpObject -> setrung(runno,2,i);
00137        tmpObject -> setrung(runresol,3,i);
00138           }
00139 
00140     
00141      double ddg0[43];
00142      double ddg1[43];
00143      double ddg2[43];
00144      double ddg3[43];
00145      double id_doca[1600];
00146      double iner_chi[1600];
00147      double iner_gain[1600]; 
00148      double iner_hits[1600]; 
00149      double ip_eangle[1600]; 
00150      double out_chi[1600];
00151      double out_gain[1600];
00152      double out_hits[1600];
00153 
00154      ddgtree -> SetBranchAddress("ddg0", ddg0);
00155      ddgtree -> SetBranchAddress("ddg1", ddg1);
00156      ddgtree -> SetBranchAddress("ddg2", ddg2);
00157      ddgtree -> SetBranchAddress("ddg3", ddg3);
00158      TBranch *bbb = ddgtree->FindBranch("Id_doca");
00159      if(bbb){
00160         ddgtree -> SetBranchAddress("Id_doca", id_doca);
00161         ddgtree -> SetBranchAddress("Iner_chi", iner_chi);
00162         ddgtree -> SetBranchAddress("Iner_gain", iner_gain);
00163         ddgtree -> SetBranchAddress("Iner_hits", iner_hits);
00164         ddgtree -> SetBranchAddress("Ip_eangle", ip_eangle);
00165         ddgtree -> SetBranchAddress("Out_chi", out_chi);
00166         ddgtree -> SetBranchAddress("Out_gain", out_gain);
00167         ddgtree -> SetBranchAddress("Out_hits", out_hits);
00168      }
00169 
00170       ddgtree -> GetEntry(0);
00171         for(int i=0; i<43; i++){
00172 
00173              tmpObject -> setddg(ddg0[i],0,i);
00174              tmpObject -> setddg(ddg1[i],1,i);
00175              tmpObject -> setddg(ddg2[i],2,i);
00176              tmpObject -> setddg(ddg3[i],3,i);
00177           }
00178   
00179       for(int i=0; i<1600; i++){
00180          if(!bbb){
00181             id_doca[i]=0;
00182             iner_chi[i]=0;
00183             iner_gain[i]=0;
00184             iner_hits[i]=0;
00185             ip_eangle[i]=0;
00186             out_chi[i]=0;
00187             out_gain[i]=0;
00188             out_hits[i]=0;
00189          }
00190                 tmpObject -> set_id_doca(id_doca[i],i);
00191                 tmpObject -> set_iner_chi(iner_chi[i],i);
00192                 tmpObject -> set_iner_gain(iner_gain[i],i);
00193                 tmpObject -> set_iner_hits(iner_hits[i],i);
00194                 tmpObject -> set_ip_eangle(ip_eangle[i],i);
00195                 tmpObject -> set_out_chi(out_chi[i],i);
00196                 tmpObject -> set_out_gain(out_gain[i],i);
00197                 tmpObject -> set_out_hits(out_hits[i],i);
00198         }
00199  
00200  
00201      double entra0[43];
00202      double entra1[43];
00203      double entra2[43];
00204      double entra3[43];
00205      double engle[100];
00206      int engle_no;
00207      entratree -> SetBranchAddress("entra0", entra0);
00208      entratree -> SetBranchAddress("entra1", entra1);
00209      entratree -> SetBranchAddress("entra2", entra2);
00210      entratree -> SetBranchAddress("entra3", entra3);
00211      entratree -> SetBranchAddress("1denangle", engle);
00212      entratree -> SetBranchAddress("1denangle_entry", &engle_no);
00213        entratree -> GetEntry(0);
00214         for(int i=0; i<43; i++){
00215              tmpObject -> setenta(entra0[i],0,i);
00216              tmpObject -> setenta(entra1[i],1,i);
00217              tmpObject -> setenta(entra2[i],2,i);
00218              tmpObject -> setenta(entra3[i],3,i);
00219           }
00220 
00221     tmpObject -> set_enanglesize(engle_no);
00222       for(int i=0; i<engle_no; i++){
00223              tmpObject -> set_enangle(engle[i],i);
00224           }
00225 
00226 
00227 
00228 
00229 // read ggscalib ------------------------------------------------------------
00230      double ggs0[43];
00231      double ggs1[43];
00232      double ggs2[43];
00233      double ggs3[43];
00234      double gcostheta[80];
00235      int hadron_entry;
00236      double hadron[20];
00237      ggstree -> SetBranchAddress("ggs0", ggs0);
00238      ggstree -> SetBranchAddress("ggs1", ggs1);
00239      ggstree -> SetBranchAddress("ggs2", ggs2);
00240      ggstree -> SetBranchAddress("ggs3", ggs3);
00241      ggstree -> SetBranchAddress("hadron", hadron);
00242      ggstree -> SetBranchAddress("hadronNo", &hadron_entry);
00243      if(bbb){
00244      ggstree -> SetBranchAddress("costheta", gcostheta);}
00245      ggstree -> GetEntry(0);
00246       for(int i=0; i<43;i++){
00247            tmpObject -> setggs(ggs0[i],0,i);
00248            tmpObject -> setggs(ggs1[i],1,i);
00249            tmpObject -> setggs(ggs2[i],2,i);
00250            tmpObject -> setggs(ggs3[i],3,i);
00251           }
00252       for(int i=0; i<80;i++){
00253            if(!bbb) gcostheta[i]=0;
00254            tmpObject ->set_costheta(gcostheta[i],i);
00255          }
00256      if(hadron_entry>20){
00257        log<<MSG::FATAL<<"hadron entry is larger than 20, larger than designed"<<endreq;
00258        return StatusCode::FAILURE;
00259       }
00260      tmpObject->set_hadronNo(hadron_entry);
00261      for(int i=0;i<hadron_entry;i++){
00262           tmpObject->set_hadron(hadron[i],i);
00263         }
00264 
00265  
00266 // read zdepcalib ------------------------------------------------------------
00267      double zdep0[43];
00268      double zdep1[43];
00269      double zdep2[43];
00270      double zdep3[43];
00271      zdeptree -> SetBranchAddress("zdep0", zdep0);
00272      zdeptree -> SetBranchAddress("zdep1", zdep1);
00273      zdeptree -> SetBranchAddress("zdep2", zdep2);
00274      zdeptree -> SetBranchAddress("zdep3", zdep3);
00275      zdeptree -> GetEntry(0);
00276 
00277      for(int i=0; i<43;i++){
00278            tmpObject -> setzdep(zdep0[i],0,i);
00279            tmpObject -> setzdep(zdep1[i],1,i);
00280            tmpObject -> setzdep(zdep2[i],2,i);
00281            tmpObject -> setzdep(zdep3[i],3,i);
00282           }
00283 // read gain ------------------------------------------------------------
00284      double gain;
00285      double gt0[35],gdedx[35];
00286      gaintree -> SetBranchAddress("gain", &gain);
00287      if(bbb){
00288      gaintree -> SetBranchAddress("t0",   gt0);
00289      gaintree -> SetBranchAddress("dedx", gdedx);}
00290            gaintree -> GetEntry(0);
00291            tmpObject -> setgain(gain);
00292      for(int i=0; i<35;i++){
00293       if(!bbb){
00294          gt0[i]=0;
00295          gdedx[i]=0;
00296       }
00297       tmpObject->set_t0(gt0[i],i);
00298       tmpObject->set_dedx(gdedx[i],i);
00299       }
00300 
00301 // read resol----------------------------------------------------------------
00302      double resol;
00303      resoltree -> SetBranchAddress("resol", &resol);
00304            resoltree -> GetEntry(0);
00305            tmpObject -> setresol(resol);
00306     
00307 // read wireg----------------------------------------------------------------
00308      double wireg[6796];
00309      wiregtree -> SetBranchAddress("wireg",wireg);
00310     wiregtree -> GetEntry(0);
00311      for(int i=0;i<6796;i++){
00312            if(wireg[i]>5||wireg[i]<0.2) wireg[i]=0;
00313            tmpObject -> setwireg(wireg[i],i);
00314      }
00315  
00316 // read layerg----------------------------------------------------------------
00317      double layerg[43];
00318      layergtree -> SetBranchAddress("layerg",layerg);
00319     layergtree -> GetEntry(0);
00320 
00321      for(int i=0;i<43;i++){
00322             tmpObject -> setlayerg(layerg[i],i);
00323      }
00324 
00325 
00326 
00327     // Read in the object
00328 
00329   
00330       refpObject=tmpObject;
00331 
00332    delete ddgtree;
00333   delete entratree;
00334   delete gaintree;
00335   delete ggstree;
00336   delete layergtree;
00337   delete resoltree;
00338   delete wiregtree;
00339   delete zdeptree;
00340   delete rungtree;
00341 
00342   return StatusCode::SUCCESS;
00343 
00344 
00345 }

StatusCode TreeCalBaseCnv::i_processObj ( DataObject *  pObject,
IOpaqueAddress *  address 
) [protected, virtual, inherited]

In case there is additional work to do on the created object.

Definition at line 190 of file TreeCalBaseCnv.cxx.

Referenced by TreeCalBaseCnv::internalCreateObj().

00191                                                                       {
00192   return StatusCode::SUCCESS;
00193 }

StatusCode TreeCalBaseCnv::initialize (  )  [virtual, inherited]

Definition at line 46 of file TreeCalBaseCnv.cxx.

References IID_ICalibMetaCnvSvc(), IID_ICalibTreeSvc(), IID_IInstrumentName(), TreeCalBaseCnv::m_instrSvc, TreeCalBaseCnv::m_metaSvc, and TreeCalBaseCnv::m_treeSvc.

00046                                       {
00047   StatusCode status = Converter::initialize();
00048 
00049   IDataProviderSvc* dp;
00050 
00051   // I guess the service names are assigned in jobOptions?
00052 
00053 /*  serviceLocator()->getService ("CalibDataSvc",
00054                                 IID_IDataProviderSvc,
00055                                 (IInterface*&)dp);*/
00056   serviceLocator()->getService ("CalibDataSvc",
00057                                 IDataProviderSvc::interfaceID(),
00058                                 (IInterface*&)dp);
00059   setDataProvider(dp);
00060   
00061   // Locate the Root Conversion Service
00062   serviceLocator()->getService ("CalibTreeCnvSvc",
00063                                 IID_ICalibTreeSvc,
00064                                 (IInterface*&) m_treeSvc);
00065 
00066   // Locate meta conversion service
00067   // Will anything need to be changed here to accommodate possibility
00068   // of two concrete implementations of ICalibMetaCnvSvc?  Would
00069   // have different storage types.  Could specify type desired
00070   // as job option.  Ditto for name of class?
00071   serviceLocator()->getService("CalibMySQLCnvSvc", 
00072                                IID_ICalibMetaCnvSvc,
00073                                 (IInterface*&)m_metaSvc);
00074 
00075   serviceLocator()->getService ("CalibDataSvc",
00076                                 IID_IInstrumentName,
00077                                 (IInterface*&)m_instrSvc);
00078 
00079   return status;
00080 }

StatusCode TreeCalBaseCnv::internalCreateObj ( DataObject *&  refpObject,
IOpaqueAddress *  address 
) [protected, virtual, inherited]

This creates the transient representation of an object from the corresponding ROOT object it, then fills it and process it. This implementation actually only calls the i_* methods of the "right" converter to do the job; so the very first thing it does is get a pointer to the appropriate derived converter. Converters typically don't need to override this method but only to override/implement some of the i_* methods.

Parameters:
pRootObj pointer to the ROOT object
refpObject the object to be built
address the opaque address for this object
Returns:
status depending on the completion of the call

Definition at line 131 of file TreeCalBaseCnv.cxx.

References Bes_Common::DEBUG, calibUtil::ERROR, TreeAddress::getRunFrom(), TreeAddress::getRunTo(), TreeCalBaseCnv::i_createObj(), TreeCalBaseCnv::i_processObj(), TreeCalBaseCnv::m_runfrm, TreeCalBaseCnv::m_runto, msgSvc(), TreeCalBaseCnv::setBaseInfo(), and Bes_Common::WARNING.

Referenced by TreeCalBaseCnv::createObj().

00132                                                                    {
00133 
00134   MsgStream log(msgSvc(), "TreeCalBaseCnv");
00135    log << MSG::DEBUG<<"TreeCalBaseCnv::internalCreateObj( starting ..... "<<endreq;
00136    TreeCalBaseCnv* converter = this;
00137   CLID classId = address->clID();
00138 
00139   IConverter* conv = this->conversionSvc()->converter(classId);
00140   if (0 == conv) {
00141     log << MSG::WARNING
00142         << "No proper converter found for classID " << classId
00143             << ", the default converter"
00144             << " will be used. " << endreq;
00145   } else {
00146     converter = dynamic_cast <TreeCalBaseCnv*> (conv);
00147     if (0 == converter) {
00148       log << MSG::ERROR
00149           << "The converter found for classID " << classId
00150               << " was not a descendent of TreeCalBaseCnv as it should be "
00151               << "( was of type " << typeid (*converter).name() << "). "
00152               << "The default converter will be used" << endreq;
00153       converter = this;
00154     }
00155   }
00156 
00157   TreeAddress* treeAddress =  dynamic_cast <TreeAddress*> (address);
00158   m_runfrm = treeAddress->getRunFrom();
00159   m_runto = treeAddress->getRunTo();
00160     //m_runfrm =*( address->ipar());
00161     //m_runto =*( address->ipar()+1);
00162  //   m_runfrm = 100;
00163  //   m_runto =1000;
00164    // creates an object for the node found
00165    StatusCode sc = converter->i_createObj(address, refpObject);
00166      if (sc.isFailure()) {
00167     return sc;
00168   } 
00169      CalibData::CalibBase1* tmpObject =  dynamic_cast <CalibData::CalibBase1*> (refpObject);
00170      setBaseInfo(tmpObject);
00171   // ends up the object construction
00172   sc = converter->i_processObj(refpObject, address);
00173   if (sc.isSuccess()) {
00174     log << MSG::DEBUG << "Successfully created calib. object " << endreq;
00175   }
00176  // closeRead();
00177   return sc;
00178 }

const CLID & TreeDedxCalibDataCnv::objType (  )  const

Definition at line 38 of file TreeDedxCalibDataCnv.cxx.

References CLID_Calib_DedxCal.

00038                                                 {
00039   return CLID_Calib_DedxCal;
00040 }

template<class Ty1, class Ty2>
destination* Converter< Ty1, Ty2 >::operator ( const source  )  const [inline, inherited]

virtual long TreeDedxCalibDataCnv::repSvcType (  )  const [inline, virtual]

Definition at line 34 of file TreeDedxCalibDataCnv.h.

References CALIBTREE_StorageType.

00034                                   { 
00035           return CALIBTREE_StorageType; 
00036       } 

void TreeCalBaseCnv::setBaseInfo ( CalibData::CalibBase1 pObj  )  [protected, inherited]

Another utility for derived classes to use.

Another convenience for derived classes: sets information belonging to the calibration base class, namely validity interval and serial number.

Definition at line 196 of file TreeCalBaseCnv.cxx.

References Bes_Common::DEBUG, TreeCalBaseCnv::m_runfrm, TreeCalBaseCnv::m_runto, msgSvc(), CalibData::CalibBase1::setrunfrm(), and CalibData::CalibBase1::setrunto().

Referenced by TreeCalBaseCnv::internalCreateObj().

00196                                                           {
00197    MsgStream log(msgSvc(), "TreeCalBaseCnv");
00198    log << MSG::DEBUG<<"set the runfrm and runto Numbers in the converter"<<endreq;
00199   pObj->setrunfrm(m_runfrm);
00200   pObj->setrunto(m_runto);
00201 }

static const unsigned char TreeCalBaseCnv::storageType (  )  [inline, static, inherited]

Definition at line 62 of file TreeCalBaseCnv.h.

References CALIBTREE_StorageType.

00062 {return CALIBTREE_StorageType;}


Friends And Related Function Documentation

friend class CnvFactory< TreeDedxCalibDataCnv > [friend]

Definition at line 22 of file TreeDedxCalibDataCnv.h.


Member Data Documentation

TFile* TreeCalBaseCnv::m_inFile [protected, inherited]

Definition at line 212 of file TreeCalBaseCnv.h.

IInstrumentName* TreeCalBaseCnv::m_instrSvc [protected, inherited]

Definition at line 202 of file TreeCalBaseCnv.h.

Referenced by TreeCalBaseCnv::initialize().

ICalibMetaCnvSvc* TreeCalBaseCnv::m_metaSvc [protected, inherited]

Definition at line 201 of file TreeCalBaseCnv.h.

Referenced by TreeCalBaseCnv::initialize().

TFile* TreeCalBaseCnv::m_outFile [protected, inherited]

Definition at line 209 of file TreeCalBaseCnv.h.

int TreeCalBaseCnv::m_runfrm [protected, inherited]

Definition at line 205 of file TreeCalBaseCnv.h.

Referenced by TreeCalBaseCnv::internalCreateObj(), and TreeCalBaseCnv::setBaseInfo().

int TreeCalBaseCnv::m_runto [protected, inherited]

Definition at line 206 of file TreeCalBaseCnv.h.

Referenced by TreeCalBaseCnv::internalCreateObj(), and TreeCalBaseCnv::setBaseInfo().

TDirectory* TreeCalBaseCnv::m_saveDir [protected, inherited]

Definition at line 214 of file TreeCalBaseCnv.h.

int TreeCalBaseCnv::m_serNo [protected, inherited]

Definition at line 204 of file TreeCalBaseCnv.h.

ICalibTreeSvc* TreeCalBaseCnv::m_treeSvc [protected, inherited]

Definition at line 200 of file TreeCalBaseCnv.h.

Referenced by TreeCalBaseCnv::getCalibTreeSvc(), and TreeCalBaseCnv::initialize().

TTree* TreeCalBaseCnv::m_ttree [protected, inherited]

Definition at line 210 of file TreeCalBaseCnv.h.


Generated on Tue Nov 29 23:36:11 2016 for BOSS_7.0.2 by  doxygen 1.4.7