CMS 3D CMS Logo

ApvAnalysisFactory Class Reference

#include <CalibTracker/SiStripAPVAnalysis/interface/ApvAnalysisFactory.h>

List of all members.

Public Types

typedef std::map< uint32_t,
ApvAnalysisVector
ApvAnalysisMap
typedef std::vector
< ApvAnalysis * > 
ApvAnalysisVector
typedef std::map< ApvAnalysis *,
uint32_t > 
InverseMap
typedef std::map< ApvAnalysis *,
int
MapNumberingPosition

Public Member Functions

 ApvAnalysisFactory (const edm::ParameterSet &pset)
 ApvAnalysisFactory (std::string theAlgorithmType, int theNumCMstripsInGroup, int theMaskCalcFlag, float theMaskNoiseCut, float theMaskDeadCut, float theMaskTruncCut, float theCutToAvoidSignal, int theEventInitNumber, int theEventIterNumber)
ApvAnalysisVector getApvAnalysis (const uint32_t nDET_ID)
std::vector< float > getCommonMode (uint32_t det_id, int apvNumber)
void getCommonMode (uint32_t det_id, ApvAnalysis::PedestalType &tmp)
float getCommonModeSlope (uint32_t det_id, int apvNumber)
void getCommonModeSlope (uint32_t det_id, ApvAnalysis::PedestalType &tmp)
void getMask (uint32_t det_id, TkApvMask::MaskType &tmp)
void getNoise (uint32_t det_id, ApvAnalysis::PedestalType &noise)
void getNoise (uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &noise)
void getPedestal (uint32_t det_id, ApvAnalysis::PedestalType &peds)
void getPedestal (uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &peds)
void getRawNoise (uint32_t det_id, ApvAnalysis::PedestalType &noise)
void getRawNoise (uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &noise)
std::string getStatus (uint32_t det_id)
float getStripNoise (uint32_t det_id, int stripNumber)
float getStripPedestal (uint32_t det_id, int stripNumber)
float getStripRawNoise (uint32_t det_id, int stripNumber)
bool instantiateApvs (uint32_t det_id, int numberOfApvs)
bool isUpdating (uint32_t detId)
void update (uint32_t det_id, const edm::DetSet< SiStripRawDigi > &in)
void updatePair (uint32_t det_id, int apvPair, const edm::DetSet< SiStripRawDigi > &in)
 ~ApvAnalysisFactory ()

Private Member Functions

void constructAuxiliaryApvClasses (ApvAnalysis *thisApv, uint32_t det_id, int thisApv)
void deleteApv (ApvAnalysis *apv)

Private Attributes

ApvAnalysisMap apvMap_
std::string theAlgorithmType_
std::string theCMType_
float theCutToAvoidSignal_
int theEventInitNumber_
int theEventIterNumber_
int theMaskCalcFlag_
float theMaskDeadCut_
float theMaskNoiseCut_
float theMaskTruncCut_
int theNumCMstripsInGroup_
bool useDB_


Detailed Description

Definition at line 25 of file ApvAnalysisFactory.h.


Member Typedef Documentation

typedef std::map< uint32_t, ApvAnalysisVector> ApvAnalysisFactory::ApvAnalysisMap

Definition at line 73 of file ApvAnalysisFactory.h.

typedef std::vector<ApvAnalysis *> ApvAnalysisFactory::ApvAnalysisVector

Definition at line 28 of file ApvAnalysisFactory.h.

typedef std::map< ApvAnalysis *, uint32_t> ApvAnalysisFactory::InverseMap

Definition at line 75 of file ApvAnalysisFactory.h.

typedef std::map< ApvAnalysis *,int > ApvAnalysisFactory::MapNumberingPosition

Definition at line 74 of file ApvAnalysisFactory.h.


Constructor & Destructor Documentation

ApvAnalysisFactory::ApvAnalysisFactory ( std::string  theAlgorithmType,
int  theNumCMstripsInGroup,
int  theMaskCalcFlag,
float  theMaskNoiseCut,
float  theMaskDeadCut,
float  theMaskTruncCut,
float  theCutToAvoidSignal,
int  theEventInitNumber,
int  theEventIterNumber 
)

ApvAnalysisFactory::ApvAnalysisFactory ( const edm::ParameterSet pset  ) 

Definition at line 26 of file ApvAnalysisFactory.cc.

References apvMap_, edm::ParameterSet::getParameter(), theAlgorithmType_, theCMType_, theCutToAvoidSignal_, theEventInitNumber_, theEventIterNumber_, theMaskCalcFlag_, theMaskDeadCut_, theMaskNoiseCut_, theMaskTruncCut_, theNumCMstripsInGroup_, and useDB_.

00026                                                                  {
00027 
00028   theCMType_ = pset.getParameter<string>("CMType");
00029   useDB_ = pset.getParameter<bool>("useDB");
00030   
00031   theAlgorithmType_ = pset.getParameter<string>("CalculatorAlgorithm");
00032   theNumCMstripsInGroup_ = pset.getParameter<int>("NumCMstripsInGroup");
00033   theMaskCalcFlag_ = pset.getParameter<int>("MaskCalculationFlag");
00034   
00035   theMaskNoiseCut_ = pset.getParameter<double>("MaskNoiseCut");
00036   theMaskDeadCut_ =  pset.getParameter<double>("MaskDeadCut");
00037   theMaskTruncCut_  = pset.getParameter<double>("MaskTruncationCut");
00038   theCutToAvoidSignal_ = pset.getParameter<double>("CutToAvoidSignal");
00039   
00040   theEventInitNumber_ =  pset.getParameter<int>("NumberOfEventsForInit");
00041   theEventIterNumber_ = pset.getParameter<int>("NumberOfEventsForIteration");
00042   apvMap_.clear();
00043 
00044  
00045 }

ApvAnalysisFactory::~ApvAnalysisFactory (  ) 

Definition at line 47 of file ApvAnalysisFactory.cc.

References apvMap_, deleteApv(), and it.

00047                                        {
00048   ApvAnalysisFactory::ApvAnalysisMap::iterator it = apvMap_.begin();
00049   for(;it!=apvMap_.end();it++)
00050     {
00051       vector<ApvAnalysis*>::iterator myApv = (*it).second.begin();
00052       for(;myApv!=(*it).second.end();myApv++)
00053   deleteApv(*myApv);
00054     }
00055   apvMap_.clear();
00056 }


Member Function Documentation

void ApvAnalysisFactory::constructAuxiliaryApvClasses ( ApvAnalysis thisApv,
uint32_t  det_id,
int  thisApv 
) [private]

Definition at line 87 of file ApvAnalysisFactory.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), TkCommonModeCalculator::setCM(), ApvAnalysis::setCommonModeCalculator(), ApvAnalysis::setMask(), ApvAnalysis::setNoiseCalculator(), ApvAnalysis::setPedestalCalculator(), TkCommonMode::setTopology(), theAlgorithmType_, theCMType_, theCutToAvoidSignal_, theEventInitNumber_, theEventIterNumber_, theMaskCalcFlag_, theMaskDeadCut_, theMaskNoiseCut_, theMaskTruncCut_, theNumCMstripsInGroup_, and useDB_.

Referenced by instantiateApvs().

00090 {
00091   //----------------------------------------------------------------
00092   // Create the ped/noise/CMN calculators, zero suppressors etc.
00093   // (Is called by addDetUnitAndConstructApvs()).
00094   //
00095   // N.B. Don't call this twice for the same APV!
00096   //-----------------------------------------------------------------
00097   // cout<<"VirtualApvAnalysisFactory::constructAuxiliaryApvClasses"<<endl;
00098   TkPedestalCalculator*   thePedestal =0;
00099   TkNoiseCalculator*      theNoise=0;
00100   TkApvMask*              theMask=0;
00101   TkCommonModeCalculator* theCM=0;
00102 
00103   TkCommonMode*   theCommonMode = new TkCommonMode();
00104   TkCommonModeTopology* theTopology = new TkCommonModeTopology(128, theNumCMstripsInGroup_);
00105   theCommonMode->setTopology(theTopology);
00106 
00107   // Create desired algorithms.
00108   if( theAlgorithmType_ == "TT6") {
00109     theMask = new TT6ApvMask(theMaskCalcFlag_,theMaskNoiseCut_,theMaskDeadCut_,theMaskTruncCut_); 
00110     theNoise = new TT6NoiseCalculator(theEventInitNumber_, theEventIterNumber_, theCutToAvoidSignal_); 
00111     thePedestal = new TT6PedestalCalculator(theEventInitNumber_, theEventIterNumber_, theCutToAvoidSignal_);
00112     theCM = new TT6CommonModeCalculator (theNoise, theMask, theCutToAvoidSignal_);
00113   } else if( "TT6NT" == theAlgorithmType_) {
00114     theMask = new TT6ApvMask( theMaskCalcFlag_,
00115                               theMaskNoiseCut_,
00116                               theMaskDeadCut_,
00117                               theMaskTruncCut_); 
00118     theNoise = new TT6NoiseCalculator( theEventInitNumber_, 
00119                                        theEventIterNumber_, 
00120                                        theCutToAvoidSignal_); 
00121     thePedestal = new TT6NTPedestalCalculator;
00122     theCM = new TT6CommonModeCalculator( theNoise, 
00123                                          theMask, 
00124                                          theCutToAvoidSignal_);
00125   } else if (theAlgorithmType_ == "MIX") {
00126     // the mask as to be defined also for SimplePedCalculator
00127     theMask = new TT6ApvMask(theMaskCalcFlag_,theMaskNoiseCut_,theMaskDeadCut_,theMaskTruncCut_); 
00128 
00129     thePedestal = new SimplePedestalCalculator(theEventInitNumber_);
00130 
00131     theNoise = new SimpleNoiseCalculator(theEventInitNumber_, useDB_); 
00132 
00133     if (theCMType_ == "Median"){
00134       theCM = new MedianCommonModeCalculator ();
00135     } else {
00136       cout << "Sorry Only Median is available for now, Mean and FastLinear are coming soon" << endl;
00137     }
00138   }
00139 
00140 
00141   if(theCommonMode)
00142     theCM->setCM(theCommonMode);
00143   if(thePedestal)
00144     theAPV->setPedestalCalculator(*thePedestal);
00145   if(theNoise)
00146     theAPV->setNoiseCalculator(*theNoise);
00147   if(theMask)
00148     theAPV->setMask(*theMask);
00149   if(theCM)
00150     theAPV->setCommonModeCalculator(*theCM);
00151 
00152 
00153 
00154 }

void ApvAnalysisFactory::deleteApv ( ApvAnalysis apv  )  [private]

Definition at line 421 of file ApvAnalysisFactory.cc.

References TkCommonModeCalculator::commonMode(), ApvAnalysis::commonModeCalculator(), ApvAnalysis::mask(), ApvAnalysis::noiseCalculator(), ApvAnalysis::pedestalCalculator(), and TkCommonMode::topology().

Referenced by ~ApvAnalysisFactory().

00421                                                   {
00422   delete &(apv->pedestalCalculator());
00423   delete &(apv->noiseCalculator());
00424   delete &(apv->mask());
00425   delete &(apv->commonModeCalculator().commonMode()->topology());
00426   delete (apv->commonModeCalculator().commonMode());
00427   delete &(apv->commonModeCalculator());
00428   delete apv;
00429 
00430 }

std::vector< ApvAnalysis * > ApvAnalysisFactory::getApvAnalysis ( const uint32_t  nDET_ID  ) 

Definition at line 80 of file ApvAnalysisFactory.cc.

References apvMap_.

Referenced by NoiseTask::book().

00081 {
00082   ApvAnalysisMap::const_iterator _apvAnalysisIter = apvMap_.find( nDET_ID);
00083 
00084   return apvMap_.end() != _apvAnalysisIter ? _apvAnalysisIter->second : std::vector<ApvAnalysis *>();
00085 }

vector< float > ApvAnalysisFactory::getCommonMode ( uint32_t  det_id,
int  apvNumber 
)

Definition at line 356 of file ApvAnalysisFactory.cc.

References apvMap_, and tmp.

00357 {
00358   vector<float> tmp;
00359   tmp.clear();
00360   map<uint32_t, vector<ApvAnalysis* > >::const_iterator theApvs_map =  apvMap_.find(detId);
00361   if(theApvs_map != apvMap_.end())
00362     {
00363       vector<ApvAnalysis* > theApvs = theApvs_map->second;
00364       
00365       tmp = theApvs[apvNumber]->commonModeCalculator().commonMode()->returnAsVector();
00366     }
00367   return tmp;
00368 }

void ApvAnalysisFactory::getCommonMode ( uint32_t  det_id,
ApvAnalysis::PedestalType tmp 
)

Definition at line 369 of file ApvAnalysisFactory.cc.

References apvMap_, i, and it.

Referenced by SiStripMonitorPedestals::analyze(), and NoiseTask::update().

00370 {
00371 
00372   map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
00373   if(apvAnalysisIt != apvMap_.end())
00374   {
00375     vector<ApvAnalysis* > theApvs = apvAnalysisIt->second;
00376     for( unsigned int i=0; i< theApvs.size(); i++)
00377     {
00378       //To be fixed. We return only the first one in the vector.
00379       vector<float> tmp_cm = theApvs[i]->commonModeCalculator().commonMode()->returnAsVector();
00380       for( unsigned int it = 0; it < tmp_cm.size(); it++)
00381         tmp.push_back( tmp_cm[it]);
00382     }
00383   }
00384 }

float ApvAnalysisFactory::getCommonModeSlope ( uint32_t  det_id,
int  apvNumber 
)

Definition at line 434 of file ApvAnalysisFactory.cc.

References apvMap_, and tmp.

00434                                                                          {
00435   map<uint32_t, vector<ApvAnalysis* > >::const_iterator theApvs_map =  apvMap_.find(detId);
00436   float tmp = -100.0;
00437   if(theApvs_map != apvMap_.end()) { 
00438     vector<ApvAnalysis* > theApvs = theApvs_map->second;
00439     tmp = theApvs[apvNumber]->commonModeCalculator().getCMSlope();
00440     return tmp;
00441   }
00442   return tmp;
00443 }

void ApvAnalysisFactory::getCommonModeSlope ( uint32_t  det_id,
ApvAnalysis::PedestalType tmp 
)

Definition at line 444 of file ApvAnalysisFactory.cc.

References apvMap_, and i.

Referenced by SiStripMonitorPedestals::analyze().

00445 {
00446   tmp.clear();
00447   map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
00448   if(apvAnalysisIt != apvMap_.end()) {
00449     vector<ApvAnalysis* > theApvs = apvAnalysisIt->second;
00450     for( unsigned int i=0; i< theApvs.size(); i++) {
00451       tmp.push_back(theApvs[i]->commonModeCalculator().getCMSlope());
00452     }
00453   }
00454 }

void ApvAnalysisFactory::getMask ( uint32_t  det_id,
TkApvMask::MaskType tmp 
)

Definition at line 386 of file ApvAnalysisFactory.cc.

References apvMap_, and i.

Referenced by SiStripNoiseDB::analyze(), SiStripMonitorPedestals::analyze(), and cms::SiStripOfflinePedNoiseToDb::endJob().

00387 {
00388   
00389   map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(det_id);
00390   if(apvAnalysisIt != apvMap_.end()) {
00391     vector<ApvAnalysis* > theApvs = apvAnalysisIt->second;
00392     for( unsigned int i=0; i< theApvs.size(); i++)
00393     {
00394       TkApvMask::MaskType theMaskType = ( theApvs[i]->mask()).mask();
00395       //cout <<"theMaskType size "<<theMaskType.size()<<endl;
00396           
00397       for( unsigned int ii=0;ii<theMaskType.size();ii++)
00398       {
00399         tmp.push_back(theMaskType[ii]);
00400         //cout <<"The Value "<<theMaskType[ii]<<" "<<ii<<endl;
00401       }
00402     }
00403   }
00404 }

void ApvAnalysisFactory::getNoise ( uint32_t  det_id,
ApvAnalysis::PedestalType noise 
)

Definition at line 294 of file ApvAnalysisFactory.cc.

References apvMap_, begin, end, and tmp.

00295 {
00296   //Get the pedestal for a given apv
00297   peds.clear();
00298   map<uint32_t, vector<ApvAnalysis* > >::const_iterator theApvs_map =  apvMap_.find(detId);
00299   if(theApvs_map != apvMap_.end())
00300     {
00301       vector<ApvAnalysis*>::const_iterator theApvs = (theApvs_map->second).begin();
00302       for(; theApvs !=  (theApvs_map->second).end();theApvs++)
00303   {
00304     ApvAnalysis::PedestalType tmp = (*theApvs)->noiseCalculator().noise();
00305     for(ApvAnalysis::PedestalType::const_iterator pit =tmp.begin(); pit!=tmp.end(); pit++) 
00306       peds.push_back(*pit);
00307   }
00308     }
00309 }

void ApvAnalysisFactory::getNoise ( uint32_t  det_id,
int  apvNumber,
ApvAnalysis::PedestalType noise 
)

Definition at line 269 of file ApvAnalysisFactory.cc.

References apvMap_.

Referenced by SiStripMonitorPedestals::analyze(), SiStripNoiseDB::analyze(), cms::SiStripOfflinePedNoiseToDb::endJob(), getStripNoise(), and NoiseTask::update().

00270 {
00271   //Get the pedestal for a given apv
00272   noise.clear();
00273   map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
00274   if(apvAnalysisIt != apvMap_.end())
00275     {
00276       vector<ApvAnalysis* > theApvs = apvAnalysisIt->second;
00277 
00278       noise = theApvs[apvNumber]->noiseCalculator().noise();
00279     }
00280 }

void ApvAnalysisFactory::getPedestal ( uint32_t  det_id,
ApvAnalysis::PedestalType peds 
)

Definition at line 242 of file ApvAnalysisFactory.cc.

References apvMap_, it, and tmp.

00243 {
00244   //Get the pedestal for a given apv
00245   peds.clear();
00246   map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
00247   if(apvAnalysisIt != apvMap_.end())
00248     {
00249       vector<ApvAnalysis* > theApvs = apvAnalysisIt->second;
00250       for(vector<ApvAnalysis*>::const_iterator it = theApvs.begin(); it != theApvs.end();it++)
00251   {
00252     ApvAnalysis::PedestalType tmp = (*it)->pedestalCalculator().pedestal();
00253     for(ApvAnalysis::PedestalType::const_iterator pit =tmp.begin(); pit!=tmp.end(); pit++) 
00254       peds.push_back(*pit);
00255   }
00256     }
00257 }

void ApvAnalysisFactory::getPedestal ( uint32_t  det_id,
int  apvNumber,
ApvAnalysis::PedestalType peds 
)

Definition at line 229 of file ApvAnalysisFactory.cc.

References apvMap_.

Referenced by SiStripPedDB::analyze(), SiStripMonitorPedestals::analyze(), cms::SiStripOfflinePedNoiseToDb::endJob(), getStripPedestal(), PedsOnlyTask::update(), and NoiseTask::update().

00230 {
00231   //Get the pedestal for a given apv
00232   peds.clear();
00233   map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
00234   if(apvAnalysisIt != apvMap_.end())
00235     {
00236       vector<ApvAnalysis*> myApvs = apvAnalysisIt->second;
00237       peds = myApvs[apvNumber]->pedestalCalculator().pedestal();
00238 
00239     }  
00240 }

void ApvAnalysisFactory::getRawNoise ( uint32_t  det_id,
ApvAnalysis::PedestalType noise 
)

Definition at line 337 of file ApvAnalysisFactory.cc.

References apvMap_, begin, end, and tmp.

00338 {
00339   //Get the pedestal for a given apv
00340   peds.clear();
00341   map<uint32_t, vector<ApvAnalysis* > >::const_iterator theApvs_map =  apvMap_.find(detId);
00342   if(theApvs_map != apvMap_.end())
00343     {
00344       vector<ApvAnalysis*>::const_iterator theApvs = (theApvs_map->second).begin();
00345       for(; theApvs !=  (theApvs_map->second).end();theApvs++)
00346   {
00347     ApvAnalysis::PedestalType tmp = (*theApvs)->pedestalCalculator().rawNoise();
00348     for(ApvAnalysis::PedestalType::const_iterator pit =tmp.begin(); pit!=tmp.end(); pit++) 
00349       peds.push_back(*pit);
00350   }
00351     }
00352 }

void ApvAnalysisFactory::getRawNoise ( uint32_t  det_id,
int  apvNumber,
ApvAnalysis::PedestalType noise 
)

Definition at line 312 of file ApvAnalysisFactory.cc.

References apvMap_.

Referenced by SiStripMonitorPedestals::analyze(), getStripRawNoise(), and PedsOnlyTask::update().

00313 {
00314   //Get the pedestal for a given apv
00315   noise.clear();
00316   map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
00317   if(apvAnalysisIt != apvMap_.end())
00318     {
00319       vector<ApvAnalysis* > theApvs = apvAnalysisIt->second;
00320 
00321       noise = theApvs[apvNumber]->pedestalCalculator().rawNoise();
00322     }
00323 }

std::string ApvAnalysisFactory::getStatus ( uint32_t  det_id  ) 

float ApvAnalysisFactory::getStripNoise ( uint32_t  det_id,
int  stripNumber 
)

Definition at line 282 of file ApvAnalysisFactory.cc.

References getNoise(), int, and pyDBSRunClass::temp.

00283 {
00284   //Get the pedestal for a given apv
00285   ApvAnalysis::PedestalType temp;
00286   int apvNumb = int(stripNumber / 128.); 
00287   int stripN = (stripNumber - apvNumb*128);
00288   
00289   getNoise(detId, apvNumb, temp);
00290   return temp[stripN];
00291 
00292 }

float ApvAnalysisFactory::getStripPedestal ( uint32_t  det_id,
int  stripNumber 
)

Definition at line 258 of file ApvAnalysisFactory.cc.

References getPedestal(), int, and pyDBSRunClass::temp.

00259 {
00260   //Get the pedestal for a given apv
00261   ApvAnalysis::PedestalType temp;
00262   int apvNumb = int(stripNumber / 128.); 
00263   int stripN = (stripNumber - apvNumb*128);
00264   
00265   getPedestal(detId, apvNumb, temp);
00266   return temp[stripN];
00267 
00268 }

float ApvAnalysisFactory::getStripRawNoise ( uint32_t  det_id,
int  stripNumber 
)

Definition at line 325 of file ApvAnalysisFactory.cc.

References getRawNoise(), int, and pyDBSRunClass::temp.

00326 {
00327   //Get the pedestal for a given apv
00328   ApvAnalysis::PedestalType temp;
00329   int apvNumb = int(stripNumber / 128.); 
00330   int stripN = (stripNumber - apvNumb*128);
00331   
00332   getRawNoise(detId, apvNumb, temp);
00333   return temp[stripN];
00334 
00335 }

bool ApvAnalysisFactory::instantiateApvs ( uint32_t  det_id,
int  numberOfApvs 
)

Definition at line 60 of file ApvAnalysisFactory.cc.

References apvMap_, constructAuxiliaryApvClasses(), GenMuonPlsPt100GeV_cfg::cout, lat::endl(), i, pyDBSRunClass::temp, and theEventIterNumber_.

Referenced by SiStripPedDB::beginJob(), SiStripNoiseDB::beginJob(), cms::SiStripOfflinePedNoiseToDb::beginJob(), PedsOnlyTask::book(), NoiseTask::book(), and SiStripMonitorPedestals::createMEs().

00060                                                                         {
00061 
00062 
00063   ApvAnalysisFactory::ApvAnalysisMap::iterator CPos = apvMap_.find(detId);
00064   if(CPos != apvMap_.end()) { 
00065     cout << " APVs for Detector Id " << detId << " already created !!!" << endl;;
00066     return false;
00067   }
00068   vector< ApvAnalysis* > temp;
00069   for(int i=0;i<numberOfApvs;i++)
00070     {
00071       ApvAnalysis* apvTmp = new ApvAnalysis(theEventIterNumber_);
00072       //      constructAuxiliaryApvClasses(apvTmp); 
00073       constructAuxiliaryApvClasses(apvTmp,detId,i); 
00074       temp.push_back(apvTmp);
00075     }
00076   apvMap_.insert(pair< uint32_t, vector< ApvAnalysis* > >(detId, temp));
00077    return true;  
00078 }

bool ApvAnalysisFactory::isUpdating ( uint32_t  detId  ) 

Definition at line 405 of file ApvAnalysisFactory.cc.

References apvMap_, and end.

00406 {
00407   bool updating = true;
00408   map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
00409   if(apvAnalysisIt != apvMap_.end())
00410     {
00411       for(vector<ApvAnalysis*>::const_iterator apvIt = (apvAnalysisIt->second).begin(); apvIt != (apvAnalysisIt->second).end(); apvIt++)  
00412   { 
00413     if(!( (*apvIt)->pedestalCalculator().status()->isUpdating() ))
00414       updating = false;
00415   }
00416     }
00417   return updating;
00418 
00419 }

void ApvAnalysisFactory::update ( uint32_t  det_id,
const edm::DetSet< SiStripRawDigi > &  in 
)

Definition at line 199 of file ApvAnalysisFactory.cc.

References apvMap_, edm::DetSet< T >::data, end, and i.

Referenced by cms::SiStripOfflinePedNoiseToDb::analyze(), SiStripPedDB::analyze(), SiStripNoiseDB::analyze(), and SiStripMonitorPedestals::analyze().

00200 {
00201   map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
00202   if(apvAnalysisIt != apvMap_.end())
00203     {
00204       int i=0;
00205        for(vector<ApvAnalysis*>::const_iterator apvIt = (apvAnalysisIt->second).begin(); apvIt != (apvAnalysisIt->second).end(); apvIt++)
00206    {
00207      edm::DetSet<SiStripRawDigi> tmpRawDigi;
00208      //it is missing the detId ...
00209      tmpRawDigi.data.reserve(128);
00210      int startStrip = 128*i;
00211      int stopStrip = startStrip + 128;
00212      
00213      for( int istrip = startStrip; istrip < stopStrip;istrip++)
00214      {
00215        if( static_cast<int>( in.data.size()) <= istrip) tmpRawDigi.data.push_back(0);
00216        else tmpRawDigi.data.push_back(in.data[istrip]); //maybe dangerous
00217      }
00218 
00219      (*apvIt)->newEvent();
00220      (*apvIt)->updateCalibration(tmpRawDigi);
00221      i++;
00222    }
00223     }
00224   
00225 }

void ApvAnalysisFactory::updatePair ( uint32_t  det_id,
int  apvPair,
const edm::DetSet< SiStripRawDigi > &  in 
)

Definition at line 157 of file ApvAnalysisFactory.cc.

References apvMap_, edm::DetSet< T >::data, end, and iter.

Referenced by PedsOnlyTask::fill(), and NoiseTask::fill().

00158 {
00159   map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
00160   if(apvAnalysisIt != apvMap_.end())
00161     {
00162       int iter=0;
00163 
00164       for(vector<ApvAnalysis*>::const_iterator apvIt = (apvAnalysisIt->second).begin(); apvIt != (apvAnalysisIt->second).end(); apvIt++)
00165   {
00166 
00167     if (iter==pairNumber*2 || iter==(2*pairNumber+1)){
00168       
00169       //      cout << "ApvAnalysisFactory::updatePair pair number " << pairNumber << endl;
00170       //      cout << "ApvAnlysis will be updated for the apv # " << iter << endl;
00171 
00172       edm::DetSet<SiStripRawDigi> tmpRawDigi;
00173       tmpRawDigi.data.reserve(128);
00174 
00175       int startStrip = 128*(iter%2);
00176       int stopStrip = startStrip + 128;
00177  
00178       for( int istrip = startStrip; istrip < stopStrip;istrip++)
00179       {
00180         if( static_cast<int>( in.data.size()) <= istrip) tmpRawDigi.data.push_back( 0);
00181         else tmpRawDigi.data.push_back(in.data[istrip]); //maybe dangerous
00182       }
00183       
00184       (*apvIt)->newEvent();
00185       (*apvIt)->updateCalibration(tmpRawDigi);
00186       
00187     }
00188 
00189     iter++;
00190   }
00191     }
00192   
00193 }// void


Member Data Documentation

ApvAnalysisMap ApvAnalysisFactory::apvMap_ [private]

Definition at line 81 of file ApvAnalysisFactory.h.

Referenced by ApvAnalysisFactory(), getApvAnalysis(), getCommonMode(), getCommonModeSlope(), getMask(), getNoise(), getPedestal(), getRawNoise(), instantiateApvs(), isUpdating(), update(), updatePair(), and ~ApvAnalysisFactory().

std::string ApvAnalysisFactory::theAlgorithmType_ [private]

Definition at line 82 of file ApvAnalysisFactory.h.

Referenced by ApvAnalysisFactory(), and constructAuxiliaryApvClasses().

std::string ApvAnalysisFactory::theCMType_ [private]

Definition at line 91 of file ApvAnalysisFactory.h.

Referenced by ApvAnalysisFactory(), and constructAuxiliaryApvClasses().

float ApvAnalysisFactory::theCutToAvoidSignal_ [private]

Definition at line 88 of file ApvAnalysisFactory.h.

Referenced by ApvAnalysisFactory(), and constructAuxiliaryApvClasses().

int ApvAnalysisFactory::theEventInitNumber_ [private]

Definition at line 89 of file ApvAnalysisFactory.h.

Referenced by ApvAnalysisFactory(), and constructAuxiliaryApvClasses().

int ApvAnalysisFactory::theEventIterNumber_ [private]

Definition at line 90 of file ApvAnalysisFactory.h.

Referenced by ApvAnalysisFactory(), constructAuxiliaryApvClasses(), and instantiateApvs().

int ApvAnalysisFactory::theMaskCalcFlag_ [private]

Definition at line 84 of file ApvAnalysisFactory.h.

Referenced by ApvAnalysisFactory(), and constructAuxiliaryApvClasses().

float ApvAnalysisFactory::theMaskDeadCut_ [private]

Definition at line 86 of file ApvAnalysisFactory.h.

Referenced by ApvAnalysisFactory(), and constructAuxiliaryApvClasses().

float ApvAnalysisFactory::theMaskNoiseCut_ [private]

Definition at line 85 of file ApvAnalysisFactory.h.

Referenced by ApvAnalysisFactory(), and constructAuxiliaryApvClasses().

float ApvAnalysisFactory::theMaskTruncCut_ [private]

Definition at line 87 of file ApvAnalysisFactory.h.

Referenced by ApvAnalysisFactory(), and constructAuxiliaryApvClasses().

int ApvAnalysisFactory::theNumCMstripsInGroup_ [private]

Definition at line 83 of file ApvAnalysisFactory.h.

Referenced by ApvAnalysisFactory(), and constructAuxiliaryApvClasses().

bool ApvAnalysisFactory::useDB_ [private]

Definition at line 92 of file ApvAnalysisFactory.h.

Referenced by ApvAnalysisFactory(), and constructAuxiliaryApvClasses().


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