EmcDynamicData Class Reference

#include <EmcDynamicData.h>

List of all members.


Detailed Description

Parses configuration file and creates storage arrays for only active channels and references data.

=============================================================================== | The purpose of EmcDynamicData class is: | | 1. to Parse script file describing EMCalchannels and references connections | | to FEMs; | | 2. to create storage arrays for only active channels and references data; | | 3. to create routers that explain Event Iterating routines/classes what | | channels should be read out and where these data should be stored. | | Actually router creates "connections" between electronics channels and | | elements of data arrays. | | | | To make your own EmcDynamicData object, just do: | |_____________________________________________________________________________| | int status; | | EmcDynamicData myobject(status,ConfigFileName);//constructor does all | | if(status) exit(1); //non-zero status means there were script errors | | int* dataMap=myobject.getEmcMap(); // get list of detector cells | | int nchannel=myobject.getEmcSize(); // get size of data arrays | | float* myHighGain=myobject.getEmcHG();//access to EMCal HighGain pre-post | |// the same for getEmcLG, getEmcTAC. | |_____________________________________________________________________________| | Boolean 'false' as a 2-nd parameter to constructor means that data from FEM | | 6x32=192 instead of 6x24=144. It means that you will get data not from | | towers only, but also from channels that are connected to different ASIC | | bias voltage levels. If you care about tower signals only, use 'true' | | instead of 'false' | |_____________________________________________________________________________| | 3-d parameter in the constructor determins if in addition to amplitudes | | you would like to get array with just raw data: tac, hipost,lopost, hipre, | | lopre. If you set 'true' then get pointer to 2D raw data aray[5][datasize] | | using float** EmcDynamicData::getEmcRaw() | |_____________________________________________________________________________| | Last parameter in the constructor determins data mapping style. 'True" | | means that DataMap array will store absolute FEM addresses: | | address=absFEM*192+ch, where absFEM - FEM# (0-171), ch -channel# (0-191). | |'False' means EMCal towers mapping style: address=tower# (0-24767). | |_____________________________________________________________________________| | Slang in this program: | | abs position-means position in the EMCal detector. For towers it is 0-24767,| | for FEM or reference - this is a position of the supermodule (12x12 | | towers) in EMCal : 0-171. EMCal is treated as 8 sectors, PbSc1, ...,PbSc6, | | PgGl1,PbGl2. In this program names of corresponding sectors are: W0,W1,W2, | | W3,E2,E3,E0,E1. Reason - Edouard asked to push PbGl as far as possible :) | =============================================================================

Definition at line 138 of file EmcDynamicData.h.

Public Member Functions

 EmcDynamicData (int &status, char *fileName, bool GetRaw=false, bool Asic24ch=true, bool EmcMapStyle=true)
 Class constructor: parses configuration file and creates all arrays for data and addresses storage.
 EmcDynamicData (int &status, emcConfigurationFile &configFile, bool GetRaw=false, bool Asic24ch=true, bool EmcMapStyle=true)
 Same as above, but input is an object (already filled) instead of a filename.
void ParseConfigurationFile (int &status, emcConfigurationFile &configFile, bool GetRaw=false, bool Asic24ch=true, bool EmcMapStyle=true)
 Leading routine for parsing of configuration file.
const SuperModulegetSmMap ()
 Returns pointer to an array of SuperModule structures.
bool getMapStyle ()
 Returns mapping style: true means EMCal style (towers number),.
bool getASICStyle ()
 Returns output style: true means only those channels that are connected to towers are readout, false means that all 32 channels of each ASIC board will be readout.
int getnSM ()
 Returns number of SuperModules.
const SuperModulegetSMMap ()
 Returns pointer to FEM configuration MAP.
int * getEmcMap ()
 Returns pointer to Data map.
float * getEmcHG ()
 Returns pointer to High Gain EMCal data.
float * getEmcLG ()
 Returns pointer to Low Gain EMCal data.
float * getEmcTAC ()
 Returns pointer to EMCal Timing data.
int getEmcSize ()
 Returns data arrays size.
float ** getEmcRaw ()
 Gives pointer to raw data structure array. If GetRaw=false then returns NULL.
EmcDatagetEmcData ()
 Returns EmcData structure that contains all pointers to data arrays.
const ReferencegetRefMap ()
 Returns pointer to array of Reference structures.
int getRefSize ()
 Returns the size of Reference structures array.
float * getRefHG ()
 Returns pointer to references High Gain data.
float * getRefLG ()
 Returns pointer to references Low Gain data.
float * getRefTAC ()
 Returns pointer to references Timing data.
float ** getRefRaw ()
 Returns pointer to references raw data.
EmcDatagetRefData ()
 Returns references data structure that contains all pointers to references data arrays.
virtual ~EmcDynamicData ()
 Destructor frees all memory allocated for data and addresses.

Static Public Member Functions

static void MBCleanStr (char *String)
static int MBControl (char *String, char *&RestString)
static int MBControl (char *String, char *&RestString, const char **names, int n)
static char * strupr (char *s)
 Converts string to upper register.

Protected Member Functions

virtual int FindSector (char *String)
virtual int ParseFEM (char *String)
virtual int ParseCHAN (char *String)
virtual int ParseREF (char *String)
virtual int ParseDELAY (char *String)
virtual int ParseDATA (char *String)
virtual int ParseMAP (char *String)
virtual void setSMad ()
virtual void setREFtoSM ()

Static Protected Member Functions

static int cmpSM (const void *s1, const void *s2)
static int cmpRef (const void *r1, const void *r2)
static int cmpCh (const void *c1, const void *c2)

Protected Attributes

int line
char * fLine
EmcData Data
EmcData Refs
int * DataMap
ReferencerefMap
bool Style
bool outputRaw
bool channelMap
int curSM
SuperModulesmMap
int nSM
int Position
int Sector
int tacDelay
int postDelay

Static Protected Attributes

static bool FEMchErr = false
static int ScriptErrors = 0


Constructor & Destructor Documentation

EmcDynamicData::EmcDynamicData int &  status,
char *  fileName,
bool  GetRaw = false,
bool  Asic24ch = true,
bool  EmcMapStyle = true
 

Class constructor: parses configuration file and creates all arrays for data and addresses storage.

int& status - gives result of object creation. status!=0 means there were error(s) found in configuration file. char* fileName - name of a configuration file. bool GetRaw - if true array for raw data storage is created and you can get a pointer to this data. bool Asic24ch - if true only FEM channels connected to EMC towers will be read out (24 for each ASIC card), if false all FEM channels (32 for each ASIC card) will be read out. Default is true. bool EmcMapStyle - if true the data map address corresponds to PHENIX tower numeration schematic, if false then it is FEM channel number.

Definition at line 694 of file EmcDynamicData.C.

References emcConfigurationFile::IsValid().

EmcDynamicData::EmcDynamicData int &  status,
emcConfigurationFile configFile,
bool  GetRaw = false,
bool  Asic24ch = true,
bool  EmcMapStyle = true
 

Same as above, but input is an object (already filled) instead of a filename.

Definition at line 708 of file EmcDynamicData.C.

References emcConfigurationFile::IsValid(), and ParseConfigurationFile().

EmcDynamicData::~EmcDynamicData  )  [virtual]
 

Destructor frees all memory allocated for data and addresses.

Definition at line 1008 of file EmcDynamicData.C.

References Data, DataMap, EmcData::hg, EmcData::lg, Refs, smMap, and EmcData::tac.


Member Function Documentation

int EmcDynamicData::cmpCh const void *  c1,
const void *  c2
[static, protected]
 

Definition at line 192 of file EmcDynamicData.C.

References FEMchErr, and ScriptErrors.

int EmcDynamicData::cmpRef const void *  r1,
const void *  r2
[static, protected]
 

Definition at line 171 of file EmcDynamicData.C.

References Reference::absPosition, ScriptErrors, and Reference::type.

int EmcDynamicData::cmpSM const void *  s1,
const void *  s2
[static, protected]
 

Definition at line 159 of file EmcDynamicData.C.

References SuperModule::absPosition, SuperModule::femPin, and ScriptErrors.

int EmcDynamicData::FindSector char *  String  )  [protected, virtual]
 

Definition at line 269 of file EmcDynamicData.C.

References sectors.

Referenced by ParseFEM(), and ParseREF().

bool EmcDynamicData::getASICStyle  )  [inline]
 

Returns output style: true means only those channels that are connected to towers are readout, false means that all 32 channels of each ASIC board will be readout.

Definition at line 231 of file EmcDynamicData.h.

References Style.

EmcData* EmcDynamicData::getEmcData  )  [inline]
 

Returns EmcData structure that contains all pointers to data arrays.

Definition at line 249 of file EmcDynamicData.h.

References Data.

float* EmcDynamicData::getEmcHG  )  [inline]
 

Returns pointer to High Gain EMCal data.

Definition at line 239 of file EmcDynamicData.h.

References Data, and EmcData::hg.

Referenced by EMCalFEE::processEvent().

float* EmcDynamicData::getEmcLG  )  [inline]
 

Returns pointer to Low Gain EMCal data.

Definition at line 241 of file EmcDynamicData.h.

References Data, and EmcData::lg.

Referenced by EMCalFEE::processEvent().

int* EmcDynamicData::getEmcMap  )  [inline]
 

Returns pointer to Data map.

Definition at line 237 of file EmcDynamicData.h.

References DataMap.

Referenced by mEmcCalibratorModule::Config(), mEmcToolsModule::EmcGetDataMap(), and emcRawDataAccessor::GetRawDataObject().

float** EmcDynamicData::getEmcRaw  )  [inline]
 

Gives pointer to raw data structure array. If GetRaw=false then returns NULL.

Definition at line 247 of file EmcDynamicData.h.

References Data, and EmcData::rawdata.

Referenced by emcRawDataAccessor::GetRawDataObject(), and EMCalFEE::processEvent().

int EmcDynamicData::getEmcSize  )  [inline]
 

Returns data arrays size.

Definition at line 245 of file EmcDynamicData.h.

References Data, and EmcData::size.

Referenced by mEmcCalibratorModule::Config(), EMCalFEE::EMCalFEE(), mEmcToolsModule::EmcGetDataMap(), and emcRawDataAccessor::GetRawDataObject().

float* EmcDynamicData::getEmcTAC  )  [inline]
 

Returns pointer to EMCal Timing data.

Definition at line 243 of file EmcDynamicData.h.

References Data, and EmcData::tac.

Referenced by EMCalFEE::processEvent().

bool EmcDynamicData::getMapStyle  )  [inline]
 

Returns mapping style: true means EMCal style (towers number),.

Definition at line 227 of file EmcDynamicData.h.

References channelMap.

Referenced by mEmcToolsModule::EmcGetDataMap(), emcRawDataCalibratorV2::SelectSource(), emcRawDataCalibratorV1::SelectSource(), and emcRawDataCalibrator::SelectSource().

int EmcDynamicData::getnSM  )  [inline]
 

Returns number of SuperModules.

Definition at line 233 of file EmcDynamicData.h.

References nSM.

Referenced by EMCalFEE::EMCalFEE(), emcDataFormatter::fillRDO(), and EMCalFEE::processEvent().

EmcData* EmcDynamicData::getRefData  )  [inline]
 

Returns references data structure that contains all pointers to references data arrays.

Definition at line 264 of file EmcDynamicData.h.

References Refs.

float* EmcDynamicData::getRefHG  )  [inline]
 

Returns pointer to references High Gain data.

Definition at line 256 of file EmcDynamicData.h.

References EmcData::hg, and Refs.

float* EmcDynamicData::getRefLG  )  [inline]
 

Returns pointer to references Low Gain data.

Definition at line 258 of file EmcDynamicData.h.

References EmcData::lg, and Refs.

const Reference* EmcDynamicData::getRefMap  )  [inline]
 

Returns pointer to array of Reference structures.

Definition at line 252 of file EmcDynamicData.h.

References refMap.

float** EmcDynamicData::getRefRaw  )  [inline]
 

Returns pointer to references raw data.

Definition at line 262 of file EmcDynamicData.h.

References EmcData::rawdata, and Refs.

Referenced by EMCalFEE::processEvent().

int EmcDynamicData::getRefSize  )  [inline]
 

Returns the size of Reference structures array.

Definition at line 254 of file EmcDynamicData.h.

References Refs, and EmcData::size.

Referenced by EMCalFEE::EMCalFEE().

float* EmcDynamicData::getRefTAC  )  [inline]
 

Returns pointer to references Timing data.

Definition at line 260 of file EmcDynamicData.h.

References Refs, and EmcData::tac.

const SuperModule* EmcDynamicData::getSMMap  )  [inline]
 

Returns pointer to FEM configuration MAP.

Definition at line 235 of file EmcDynamicData.h.

References smMap.

Referenced by emcDataFormatter::fillRDO().

const SuperModule* EmcDynamicData::getSmMap  )  [inline]
 

Returns pointer to an array of SuperModule structures.

Definition at line 224 of file EmcDynamicData.h.

References smMap.

Referenced by EMCalFEE::processEvent().

void EmcDynamicData::MBCleanStr char *  String  )  [static]
 

Definition at line 219 of file EmcDynamicData.C.

References strupr().

Referenced by ParseConfigurationFile().

int EmcDynamicData::MBControl char *  String,
char *&  RestString,
const char **  names,
int  n
[static]
 

Definition at line 251 of file EmcDynamicData.C.

int EmcDynamicData::MBControl char *  String,
char *&  RestString
[static]
 

Definition at line 235 of file EmcDynamicData.C.

References dev.

Referenced by ParseConfigurationFile().

int EmcDynamicData::ParseCHAN char *  String  )  [protected, virtual]
 

Definition at line 440 of file EmcDynamicData.C.

Referenced by ParseConfigurationFile().

void EmcDynamicData::ParseConfigurationFile int &  status,
emcConfigurationFile configFile,
bool  GetRaw = false,
bool  Asic24ch = true,
bool  EmcMapStyle = true
 

Leading routine for parsing of configuration file.

Definition at line 722 of file EmcDynamicData.C.

References CHAN, channelMap, curSM, DATA, Data, DataMap, DELAY, FEM, FEMchErr, fLine, emcConfigurationFile::GetLine(), EmcData::hg, EmcData::lg, line, MAP, MBCleanStr(), MBControl(), nSM, outputRaw, ParseCHAN(), ParseDATA(), ParseDELAY(), ParseFEM(), ParseMAP(), ParseREF(), EmcData::rawdata, REF, refMap, Refs, emcConfigurationFile::Rewind(), ScriptErrors, EmcData::size, smMap, Style, and EmcData::tac.

Referenced by EmcDynamicData().

int EmcDynamicData::ParseDATA char *  String  )  [protected, virtual]
 

Definition at line 331 of file EmcDynamicData.C.

References DATAkeywords, fLine, line, ScriptErrors, and Style.

Referenced by ParseConfigurationFile().

int EmcDynamicData::ParseDELAY char *  String  )  [protected, virtual]
 

Definition at line 279 of file EmcDynamicData.C.

References curSM, DELAYkeywords, fLine, line, SuperModule::post_pre, postDelay, ScriptErrors, smMap, SuperModule::tac_pre, and tacDelay.

Referenced by ParseConfigurationFile().

int EmcDynamicData::ParseFEM char *  String  )  [protected, virtual]
 

Definition at line 344 of file EmcDynamicData.C.

References SuperModule::absPosition, SuperModule::adRef, curSM, EMCcode, SuperModule::femCh, FEMkeywords, SuperModule::femPin, FindSector(), fLine, line, SuperModule::nch, SuperModule::nref, SuperModule::nrefCh, nSM, SuperModule::packet, Position, SuperModule::post_pre, postDelay, SuperModule::refCh, ScriptErrors, SectorFEM, smMap, SuperModule::startRad, SuperModule::startTad, SuperModule::tac_pre, and tacDelay.

Referenced by ParseConfigurationFile().

int EmcDynamicData::ParseMAP char *  String  )  [protected, virtual]
 

Definition at line 318 of file EmcDynamicData.C.

References channelMap, fLine, line, MAPkeywords, and ScriptErrors.

Referenced by ParseConfigurationFile().

int EmcDynamicData::ParseREF char *  String  )  [protected, virtual]
 

Definition at line 602 of file EmcDynamicData.C.

References Reference::absFEM, SuperModule::absPosition, Reference::absPosition, Reference::chan, curSM, FindSector(), fLine, line, SuperModule::nrefCh, Reference::nSMch, SuperModule::refCh, REFkeywords, refMap, Refs, ScriptErrors, SectorFEM, EmcData::size, smMap, Reference::startSMad, Style, and Reference::type.

Referenced by ParseConfigurationFile().

void EmcDynamicData::setREFtoSM  )  [protected, virtual]
 

Definition at line 964 of file EmcDynamicData.C.

References SuperModule::adRef, r, refMap, Refs, EmcData::size, smMap, Reference::startSMad, and SuperModule::startTad.

void EmcDynamicData::setSMad  )  [protected, virtual]
 

Definition at line 952 of file EmcDynamicData.C.

References SuperModule::nch, SuperModule::nrefCh, smMap, and SuperModule::startRad.

char * EmcDynamicData::strupr char *  s  )  [static]
 

Converts string to upper register.

Definition at line 207 of file EmcDynamicData.C.

Referenced by MBCleanStr().


Member Data Documentation

bool EmcDynamicData::channelMap [protected]
 

Definition at line 153 of file EmcDynamicData.h.

Referenced by getMapStyle(), ParseConfigurationFile(), and ParseMAP().

int EmcDynamicData::curSM [protected]
 

Definition at line 155 of file EmcDynamicData.h.

Referenced by ParseConfigurationFile(), ParseDELAY(), ParseFEM(), and ParseREF().

EmcData EmcDynamicData::Data [protected]
 

Definition at line 143 of file EmcDynamicData.h.

Referenced by getEmcData(), getEmcHG(), getEmcLG(), getEmcRaw(), getEmcSize(), getEmcTAC(), ParseConfigurationFile(), and ~EmcDynamicData().

int* EmcDynamicData::DataMap [protected]
 

Definition at line 145 of file EmcDynamicData.h.

Referenced by getEmcMap(), ParseConfigurationFile(), and ~EmcDynamicData().

bool EmcDynamicData::FEMchErr = false [static, protected]
 

Definition at line 154 of file EmcDynamicData.h.

Referenced by cmpCh(), and ParseConfigurationFile().

char* EmcDynamicData::fLine [protected]
 

Definition at line 142 of file EmcDynamicData.h.

Referenced by ParseConfigurationFile(), ParseDATA(), ParseDELAY(), ParseFEM(), ParseMAP(), and ParseREF().

int EmcDynamicData::line [protected]
 

Definition at line 141 of file EmcDynamicData.h.

Referenced by ParseConfigurationFile(), ParseDATA(), ParseDELAY(), ParseFEM(), ParseMAP(), and ParseREF().

int EmcDynamicData::nSM [protected]
 

Definition at line 158 of file EmcDynamicData.h.

Referenced by getnSM(), ParseConfigurationFile(), and ParseFEM().

bool EmcDynamicData::outputRaw [protected]
 

Definition at line 152 of file EmcDynamicData.h.

Referenced by ParseConfigurationFile().

int EmcDynamicData::Position [protected]
 

Definition at line 160 of file EmcDynamicData.h.

Referenced by ParseFEM().

int EmcDynamicData::postDelay [protected]
 

Definition at line 166 of file EmcDynamicData.h.

Referenced by ParseDELAY(), and ParseFEM().

Reference* EmcDynamicData::refMap [protected]
 

Definition at line 146 of file EmcDynamicData.h.

Referenced by getRefMap(), ParseConfigurationFile(), ParseREF(), and setREFtoSM().

EmcData EmcDynamicData::Refs [protected]
 

Definition at line 144 of file EmcDynamicData.h.

Referenced by getRefData(), getRefHG(), getRefLG(), getRefRaw(), getRefSize(), getRefTAC(), ParseConfigurationFile(), ParseREF(), setREFtoSM(), and ~EmcDynamicData().

int EmcDynamicData::ScriptErrors = 0 [static, protected]
 

Definition at line 169 of file EmcDynamicData.h.

Referenced by cmpCh(), cmpRef(), cmpSM(), ParseConfigurationFile(), ParseDATA(), ParseDELAY(), ParseFEM(), ParseMAP(), and ParseREF().

int EmcDynamicData::Sector [protected]
 

Definition at line 161 of file EmcDynamicData.h.

SuperModule* EmcDynamicData::smMap [protected]
 

Definition at line 157 of file EmcDynamicData.h.

Referenced by getSMMap(), getSmMap(), ParseConfigurationFile(), ParseDELAY(), ParseFEM(), ParseREF(), setREFtoSM(), setSMad(), and ~EmcDynamicData().

bool EmcDynamicData::Style [protected]
 

Definition at line 148 of file EmcDynamicData.h.

Referenced by getASICStyle(), ParseConfigurationFile(), ParseDATA(), and ParseREF().

int EmcDynamicData::tacDelay [protected]
 

Definition at line 165 of file EmcDynamicData.h.

Referenced by ParseDELAY(), and ParseFEM().


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