emcBadModulesv1 Class Reference
[Tower calibration]

#include <emcBadModulesv1.h>

Inherits emcBadModules.

Inheritance diagram for emcBadModulesv1:

Inheritance graph
[legend]
List of all members.

Detailed Description

Implementation of emcBadModules.

The QA "online" information comes from calib.emc.QAs database (typically filled by onlcal, while the QA "physics" information comes from calib.emc.RejectList (typically filled after we started the first analysis on the data, i.e. we always exclude some more towers offline than online).

Definition at line 32 of file emcBadModulesv1.h.

Public Member Functions

 emcBadModulesv1 (const emcBadModulesv1 &)
 Copy ctor.
emcBadModulesv1operator= (const emcBadModulesv1 &)
emcBadModulesv1clone (void) const
virtual ~emcBadModulesv1 ()
 Dtor.
void identify (std::ostream &os=std::cout) const
int isValid () const
void Reset ()
 Reset ==> all is perfect.
std::ostream & Print (int towerid=-1, std::ostream &out=std::cout)
 Print one tower info (or all if towerid=-1).
unsigned int size (void) const
 Number of towers.
Constructors
In each ctor, the init flag has the following meaning :
  • true => whole EMCAL Q&A information is retrieved.
  • false => dead/warnmap are computed only when you request information for a given channel AND you do not use the *Fast methods. This currently can NOT be used if you're reading from Objy, as Objy accesses have to be grouped at the beginning of the program.


 emcBadModulesv1 ()
 Default ctor : everything is perfect.
 emcBadModulesv1 (const char *directory, emcBadModules::EInformationOrigin origin=emcBadModules::kAll, bool init=true, const char *sectors="emcal")
 Ctor from files.
 emcBadModulesv1 (const PHTimeStamp &ts, emcBadModules::EInformationOrigin origin=emcBadModules::kAll, const emcDataStorageMap &source=emcDataStorageMap(emcManageable::kDB_Pg), bool init=true, const char *sectors="emcal")
 Ctor with potentially different sources for QAs and RejectList.
Retrieve dead/warn neighbour information.
The 'Fast' methods do not do any check, i.e. no bound checking nor check whereas information is available/uptodate or not

unsigned int Deadmap (int towerID)
 Get deadneighbours information for the tower referenced by towerID.
unsigned int DeadmapFast (int towerID) const
unsigned int Warnmap (int towerID)
 Get warnneighbours information for the tower referenced by towerID.
unsigned int WarnmapFast (int towerID) const
Access to underlying separate information (Q&A from online,
Q&A from physics). The 'Fast' methods do not do any check, i.e. no bound checking nor check whereas information is available/uptodate or not.

unsigned int Error (emcBadModules::EInformationOrigin source, int towerID)
unsigned int ErrorFast (emcBadModules::EInformationOrigin source, int towerID) const
unsigned int Warning (emcBadModules::EInformationOrigin source, int towerID)
unsigned int WarningFast (emcBadModules::EInformationOrigin source, int towerID) const

Private Types

typedef std::map< EInformationOrigin,
std::vector< unsigned int
> >::const_iterator 
RawMapIterator

Private Member Functions

void Allocate (void)
std::string CollectPhysicsQA (void)
 Collect Q&A obtained from physics.
std::string CollectOnlineQA (void)
 Collect Q&A obtained from online (all FEMs).
std::string CollectOnlineQA (size_t ifem)
 Collect Q&A obtained from online (one FEMs).
void Collect (size_t ifem)
void ComputeMaps (size_t ifem)
 From all Q&A (online and physics), compute the dead and warn neighbour maps for a given fem.
void ComputeMaps (const char *sectors="emcal")
 Compute dead and warn maps for all FEMs.
void GetListOfNeighbourFEMs (size_t ifem, std::vector< size_t > &fems)
 Return in vector fems the ids of FEMs that are neighbours of ifem.
bool IsValid (int towerID) const
 Returns true if towerID can be used as an index for our internal storage elements (fErrorRaw, .
void update (int towerID)
 Insure that we get all the information collected (either from files or from DB) in order to get sensible return values from Error* or Warning* methods.
std::ostream & PrintOne (int towerid, std::ostream &out=std::cout)
 Print info about one tower.
void copyTo (emcBadModulesv1 &) const
 Used by copy ctor and assignment operator.

Private Attributes

emcDataStorageMap fDataSource
emcBadModules::EInformationOrigin fOrigin
std::string fDirectory
PHTimeStamp fTimeStamp
bool fIsRejectListAlreadyRead
std::vector< unsigned int > fErrorMap
std::vector< unsigned int > fWarnMap
std::vector< bool > fCollectedFEMs
std::vector< bool > fComputedFEMs
std::map< EInformationOrigin,
std::vector< unsigned int > > 
fErrorRaw
std::map< EInformationOrigin,
std::vector< unsigned int > > 
fWarnRaw

Static Private Attributes

static const unsigned int fMASK_Ampl_Physics = 0x0000F
static const unsigned int fMASK_Ampl_Online = 0x40000
static const unsigned int fMASK_Ampl_OnlineWarn = 0x00000
static const unsigned int fMASK_TOF_Physics = 0x000F0
static const unsigned int fMASK_TOF_Online = 0x00000
static const unsigned int fMASK_TOF_OnlineWarn = 0x00000


Member Typedef Documentation

typedef std::map<EInformationOrigin, std::vector<unsigned int> >::const_iterator emcBadModulesv1::RawMapIterator [private]
 

Definition at line 187 of file emcBadModulesv1.h.


Constructor & Destructor Documentation

emcBadModulesv1::emcBadModulesv1  ) 
 

Default ctor : everything is perfect.

Referenced by clone().

emcBadModulesv1::emcBadModulesv1 const char *  directory,
emcBadModules::EInformationOrigin  origin = emcBadModules::kAll,
bool  init = true,
const char *  sectors = "emcal"
 

Ctor from files.

Definition at line 41 of file emcBadModulesv1.C.

References Allocate(), and ComputeMaps().

emcBadModulesv1::emcBadModulesv1 const PHTimeStamp &  ts,
emcBadModules::EInformationOrigin  origin = emcBadModules::kAll,
const emcDataStorageMap source = emcDataStorageMap(emcManageable::kDB_Pg),
bool  init = true,
const char *  sectors = "emcal"
 

Ctor with potentially different sources for QAs and RejectList.

By default, both are read from Pg

Definition at line 59 of file emcBadModulesv1.C.

References Allocate(), and ComputeMaps().

emcBadModulesv1::emcBadModulesv1 const emcBadModulesv1  ) 
 

Copy ctor.

Definition at line 78 of file emcBadModulesv1.C.

References copyTo().

emcBadModulesv1::~emcBadModulesv1  )  [virtual]
 

Dtor.

Definition at line 112 of file emcBadModulesv1.C.


Member Function Documentation

void emcBadModulesv1::Allocate void   )  [private]
 

Definition at line 119 of file emcBadModulesv1.C.

References fCollectedFEMs, fComputedFEMs, fErrorMap, fErrorRaw, fWarnMap, fWarnRaw, emcBadModules::kOnline, emcBadModules::kPhysics, NCHANNELS, NFEMS, and size().

Referenced by emcBadModulesv1(), and Reset().

emcBadModulesv1* emcBadModulesv1::clone void   )  const [inline, virtual]
 

Implements emcBadModules.

Definition at line 73 of file emcBadModulesv1.h.

References emcBadModulesv1().

void emcBadModulesv1::Collect size_t  ifem  )  [private]
 

Definition at line 136 of file emcBadModulesv1.C.

References CollectOnlineQA(), CollectPhysicsQA(), fCollectedFEMs, fOrigin, emcBadModules::kAll, emcBadModules::kOnline, and emcBadModules::kPhysics.

Referenced by ComputeMaps().

string emcBadModulesv1::CollectOnlineQA size_t  ifem  )  [private]
 

Collect Q&A obtained from online (one FEMs).

Definition at line 212 of file emcBadModulesv1.C.

References fDataSource, emcManageable::kNone, and emcDataStorageMap::storage().

string emcBadModulesv1::CollectOnlineQA void   )  [private]
 

Collect Q&A obtained from online (all FEMs).

Definition at line 197 of file emcBadModulesv1.C.

References NFEMS.

Referenced by Collect().

string emcBadModulesv1::CollectPhysicsQA void   )  [private]
 

Collect Q&A obtained from physics.

Definition at line 153 of file emcBadModulesv1.C.

References fDataSource, fIsRejectListAlreadyRead, emcManageable::kNone, and emcDataStorageMap::storage().

Referenced by Collect().

void emcBadModulesv1::ComputeMaps const char *  sectors = "emcal"  )  [private]
 

Compute dead and warn maps for all FEMs.

Definition at line 254 of file emcBadModulesv1.C.

References ComputeMaps(), fDataSource, fDirectory, fTimeStamp, emcFEMList::hasFEM(), emcManageable::kNone, NFEMS, and emcDataStorageMap::storage().

void emcBadModulesv1::ComputeMaps size_t  ifem  )  [private]
 

From all Q&A (online and physics), compute the dead and warn neighbour maps for a given fem.

Definition at line 278 of file emcBadModulesv1.C.

References Collect(), fCollectedFEMs, fComputedFEMs, and GetListOfNeighbourFEMs().

Referenced by ComputeMaps(), emcBadModulesv1(), and update().

void emcBadModulesv1::copyTo emcBadModulesv1  )  const [private]
 

Used by copy ctor and assignment operator.

Definition at line 97 of file emcBadModulesv1.C.

References fCollectedFEMs, fComputedFEMs, fDataSource, fDirectory, fErrorMap, fErrorRaw, fOrigin, fTimeStamp, fWarnMap, and fWarnRaw.

Referenced by emcBadModulesv1(), and operator=().

unsigned int emcBadModulesv1::Deadmap int  towerID  )  [virtual]
 

Get deadneighbours information for the tower referenced by towerID.

Implements emcBadModules.

Definition at line 478 of file emcBadModulesv1.C.

References DeadmapFast(), IsValid(), and update().

unsigned int emcBadModulesv1::DeadmapFast int  towerID  )  const [virtual]
 

Implements emcBadModules.

Definition at line 487 of file emcBadModulesv1.C.

References fErrorMap.

Referenced by Deadmap().

unsigned int emcBadModulesv1::Error emcBadModules::EInformationOrigin  source,
int  towerID
[virtual]
 

Implements emcBadModules.

Definition at line 450 of file emcBadModulesv1.C.

References ErrorFast(), IsValid(), and update().

unsigned int emcBadModulesv1::ErrorFast emcBadModules::EInformationOrigin  source,
int  towerID
const [virtual]
 

Implements emcBadModules.

Definition at line 461 of file emcBadModulesv1.C.

References fErrorRaw.

Referenced by Error().

void emcBadModulesv1::GetListOfNeighbourFEMs size_t  ifem,
std::vector< size_t > &  fems
[private]
 

Return in vector fems the ids of FEMs that are neighbours of ifem.

Referenced by ComputeMaps().

void emcBadModulesv1::identify std::ostream &  os = std::cout  )  const
 

Definition at line 536 of file emcBadModulesv1.C.

bool emcBadModulesv1::IsValid int  towerID  )  const [private]
 

Returns true if towerID can be used as an index for our internal storage elements (fErrorRaw, .

..).

Definition at line 550 of file emcBadModulesv1.C.

References fErrorMap.

Referenced by Deadmap(), Error(), Warning(), and Warnmap().

int emcBadModulesv1::isValid  )  const
 

Definition at line 543 of file emcBadModulesv1.C.

emcBadModulesv1 & emcBadModulesv1::operator= const emcBadModulesv1  ) 
 

Definition at line 86 of file emcBadModulesv1.C.

References copyTo().

std::ostream& emcBadModulesv1::Print int  towerid = -1,
std::ostream &  out = std::cout
[virtual]
 

Print one tower info (or all if towerid=-1).

Implements emcBadModules.

std::ostream& emcBadModulesv1::PrintOne int  towerid,
std::ostream &  out = std::cout
[private]
 

Print info about one tower.

void emcBadModulesv1::Reset  ) 
 

Reset ==> all is perfect.

Definition at line 633 of file emcBadModulesv1.C.

References Allocate(), emcDataStorageMap::clear(), fDataSource, fDirectory, fIsRejectListAlreadyRead, fOrigin, fTimeStamp, and emcBadModules::kNone.

unsigned int emcBadModulesv1::size void   )  const [inline, virtual]
 

Number of towers.

Implements emcBadModules.

Definition at line 124 of file emcBadModulesv1.h.

References fErrorMap.

Referenced by Allocate().

void emcBadModulesv1::update int  towerID  )  [private]
 

Insure that we get all the information collected (either from files or from DB) in order to get sensible return values from Error* or Warning* methods.

Definition at line 652 of file emcBadModulesv1.C.

References ComputeMaps(), fCollectedFEMs, fComputedFEMs, and EmcIndexer::PXPXSM144CH().

Referenced by Deadmap(), Error(), Warning(), and Warnmap().

unsigned int emcBadModulesv1::Warning emcBadModules::EInformationOrigin  source,
int  towerID
[virtual]
 

Implements emcBadModules.

Definition at line 667 of file emcBadModulesv1.C.

References IsValid(), update(), and WarningFast().

unsigned int emcBadModulesv1::WarningFast emcBadModules::EInformationOrigin  source,
int  towerID
const [virtual]
 

Implements emcBadModules.

Definition at line 677 of file emcBadModulesv1.C.

References fWarnRaw.

Referenced by Warning().

unsigned int emcBadModulesv1::Warnmap int  towerID  )  [virtual]
 

Get warnneighbours information for the tower referenced by towerID.

Implements emcBadModules.

Definition at line 694 of file emcBadModulesv1.C.

References IsValid(), update(), and WarnmapFast().

unsigned int emcBadModulesv1::WarnmapFast int  towerID  )  const [virtual]
 

Implements emcBadModules.

Definition at line 703 of file emcBadModulesv1.C.

References fWarnMap.

Referenced by Warnmap().


Member Data Documentation

std::vector<bool> emcBadModulesv1::fCollectedFEMs [private]
 

Definition at line 179 of file emcBadModulesv1.h.

Referenced by Allocate(), Collect(), ComputeMaps(), copyTo(), and update().

std::vector<bool> emcBadModulesv1::fComputedFEMs [private]
 

Definition at line 180 of file emcBadModulesv1.h.

Referenced by Allocate(), ComputeMaps(), copyTo(), and update().

emcDataStorageMap emcBadModulesv1::fDataSource [private]
 

Definition at line 170 of file emcBadModulesv1.h.

Referenced by CollectOnlineQA(), CollectPhysicsQA(), ComputeMaps(), copyTo(), and Reset().

std::string emcBadModulesv1::fDirectory [private]
 

Definition at line 172 of file emcBadModulesv1.h.

Referenced by ComputeMaps(), copyTo(), and Reset().

std::vector<unsigned int> emcBadModulesv1::fErrorMap [private]
 

Definition at line 176 of file emcBadModulesv1.h.

Referenced by Allocate(), copyTo(), DeadmapFast(), IsValid(), and size().

std::map<EInformationOrigin, std::vector<unsigned int> > emcBadModulesv1::fErrorRaw [private]
 

Definition at line 182 of file emcBadModulesv1.h.

Referenced by Allocate(), copyTo(), and ErrorFast().

bool emcBadModulesv1::fIsRejectListAlreadyRead [private]
 

Definition at line 174 of file emcBadModulesv1.h.

Referenced by CollectPhysicsQA(), and Reset().

const unsigned int emcBadModulesv1::fMASK_Ampl_Online = 0x40000 [static, private]
 

Definition at line 190 of file emcBadModulesv1.h.

const unsigned int emcBadModulesv1::fMASK_Ampl_OnlineWarn = 0x00000 [static, private]
 

Definition at line 191 of file emcBadModulesv1.h.

const unsigned int emcBadModulesv1::fMASK_Ampl_Physics = 0x0000F [static, private]
 

Definition at line 189 of file emcBadModulesv1.h.

const unsigned int emcBadModulesv1::fMASK_TOF_Online = 0x00000 [static, private]
 

Definition at line 194 of file emcBadModulesv1.h.

const unsigned int emcBadModulesv1::fMASK_TOF_OnlineWarn = 0x00000 [static, private]
 

Definition at line 195 of file emcBadModulesv1.h.

const unsigned int emcBadModulesv1::fMASK_TOF_Physics = 0x000F0 [static, private]
 

Definition at line 193 of file emcBadModulesv1.h.

emcBadModules::EInformationOrigin emcBadModulesv1::fOrigin [private]
 

Definition at line 171 of file emcBadModulesv1.h.

Referenced by Collect(), copyTo(), and Reset().

PHTimeStamp emcBadModulesv1::fTimeStamp [private]
 

Definition at line 173 of file emcBadModulesv1.h.

Referenced by ComputeMaps(), copyTo(), and Reset().

std::vector<unsigned int> emcBadModulesv1::fWarnMap [private]
 

Definition at line 177 of file emcBadModulesv1.h.

Referenced by Allocate(), copyTo(), and WarnmapFast().

std::map<EInformationOrigin, std::vector<unsigned int> > emcBadModulesv1::fWarnRaw [private]
 

Definition at line 183 of file emcBadModulesv1.h.

Referenced by Allocate(), copyTo(), and WarningFast().


The documentation for this class was generated from the following files: