CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Attributes

EcalTBEventHeader Class Reference

#include <EcalTBEventHeader.h>

List of all members.

Classes

struct  magnetsMeasurement

Public Types

enum  LaserType { LBlue = 440, LGreen = 495, LRed = 709, LInfrared = 800 }
typedef struct
EcalTBEventHeader::magnetsMeasurement 
magnetsMeasurement_t

Public Member Functions

int begBurstLV1A () const
 Returns the begin burst time (msec)
int begBurstTimeMsec () const
 Returns the begin burst time (msec)
int begBurstTimeSec () const
 Returns the begin burst time (sec)
short burstNumber () const
 Returns the burst number.
int crystalInBeam () const
 Returns the crystal which is being hit by the beam (in the internal SM numbering scheme)
int date () const
 Returns the date in Unix time.
int dbEventType () const
 Returns the event type as in the H4ROOTDB.
 EcalTBEventHeader ()
int endBurstLV1A () const
 Returns the end burst time (sec)
int endBurstTimeMsec () const
 Returns the end burst time (msec)
int endBurstTimeSec () const
 Returns the end burst time (sec)
int eventNumber () const
 Returns the event number.
std::string eventType () const
int laserType () const
 return the event laser type
LaserType laserTypeName () const
int lightIntensity () const
 return the laser intensity
const std::vector
< magnetsMeasurement_t > & 
magnetMeasurements () const
int nextCrystalInBeam () const
int nominalCrystalInBeam () const
int numberOfMagnetMeasurements () const
unsigned int phiTableIndex () const
 Returns the phi table index.
int runNumber () const
int S6ADC () const
 returns S6 ADC value
int scaler (int scalerId) const
void setBegBurstLV1A (const int &begBurstLV1A)
void setBegBurstTimeMsec (const int &begBurstTimeMsec)
void setBegBurstTimeSec (const int &begBurstTimeSec)
void setBurstNumber (const short &burstNumber)
void setCrystalInBeam (const DetId &crystalInBeam)
void setDate (const int &date)
void setEndBurstLV1A (const int &endBurstLV1A)
void setEndBurstTimeMsec (const int &endBurstTimeMsec)
void setEndBurstTimeSec (const int &endBurstTimeSec)
void setEventNumber (const int &eventNumber)
void setLaserType (const int &laserType)
void setLightIntensity (const int &lightIntensity)
void setMagnetMeasurements (const std::vector< magnetsMeasurement_t > &magnetMeasurements)
void setNextCrystalInBeam (const DetId &crystalInBeam)
void setNominalCrystalInBeam (const DetId &crystalInBeam)
void setNumberOfMagnetMeasurements (const int &numberOfMagnetMeasurements)
void setPhiTableIndex (const unsigned int &phiTableIndex)
void setRunNumber (const int &runNumber)
void setS6ADC (const int &S6ADC)
void setScalers (const std::vector< int > &scalers)
void setSmInBeam (const int &smInBeam)
void setSyncError (const bool &syncError)
void setTableIsMoving (const bool &tableIsMoving)
void setTableIsMovingAtBegSpill (const bool &tableIsMoving)
void setThetaTableIndex (const unsigned int &thetaTableIndex)
void setTriggerMask (const int &triggerMask)
short smInBeam () const
 Returns the burst number.
bool syncError () const
 is there any sync error
bool tableIsMoving () const
 Tell if the table is Moving.
bool tableIsMovingAtBegSpill () const
 Tell if the table is Moving At the begin of the spill (available in runs only after 1st August 06)
unsigned int thetaTableIndex () const
 Returns the theta table index.
int triggerMask () const
 Returns the trigger mask.
 ~EcalTBEventHeader ()

Private Attributes

int begBurstLV1A_
int begBurstTime_msec_
int begBurstTime_sec_
 Information from the ecalSupervisor.
short burstNumber_
 The number of the burst.
DetId crystalInBeam_
 Information from the table Supervisor.
int date_
 The date when the run was taken.
int endBurstLV1A_
int endBurstTime_msec_
int endBurstTime_sec_
int eventNumber_
 The numner of the event.
int laserType_
 The laser type --see enum LaserType.
int lightIntensity_
 The light intensity.
std::vector< magnetsMeasurement_tmagnetMeasurements_
DetId nextCrystalInBeam_
 The nominal next crystal which should be hit by the beam.
DetId nominalCrystalInBeam_
 The nominal crystal which should be hit by the beam.
int numberOfMagnetMeasurements_
 Magnet currents.
unsigned int phiTableIndex_
 Phi table index (Y)
int runNumber_
 The number of the run.
int S6ADC_
 ADC lecture of the S6 counter.
std::vector< int > scalers_
short smInBeam_
bool syncError_
bool tableIsMoving_
bool tableIsMovingAtBegSpill_
unsigned int thetaTableIndex_
 Theta table index (X)
int triggerMask_
 The trigger mask.

Detailed Description

Container for event ancilllary informations defined in TB raw data formats

Id:
EcalTBEventHeader.h,v 1.9 2007/01/08 15:30:34 meridian Exp

Definition at line 16 of file EcalTBEventHeader.h.


Member Typedef Documentation


Member Enumeration Documentation

SHOULD WE REMOVE ALL THIS??? Unique codes for the 4 lasers

The Caltech laser system (resp. R. Zhu, contact at CERN A. Bornheim) is a two-laser (2 times "YLF and Ti:Sapphire lasers") which provides 25 ns (FWHM) pulses at 4 different wavelengths:

  1. Laser 1 Blue (violet) 440 nm Green (blue) 495 nm
  2. Laser 2 Red 709 nm Infrared 801 nm
Enumerator:
LBlue 
LGreen 

440 nm

LRed 

495 nm

LInfrared 

709 nm

Definition at line 140 of file EcalTBEventHeader.h.

                 {
    LBlue     = 440, 
    LGreen    = 495, 
    LRed      = 709, 
    LInfrared = 800  
  };

Constructor & Destructor Documentation

EcalTBEventHeader::EcalTBEventHeader ( ) [inline]

Definition at line 20 of file EcalTBEventHeader.h.

{};
EcalTBEventHeader::~EcalTBEventHeader ( ) [inline]

Definition at line 22 of file EcalTBEventHeader.h.

{};

Member Function Documentation

int EcalTBEventHeader::begBurstLV1A ( ) const [inline]

Returns the begin burst time (msec)

Definition at line 78 of file EcalTBEventHeader.h.

References begBurstLV1A_.

Referenced by setBegBurstLV1A().

                          {
    return begBurstLV1A_;
  }
int EcalTBEventHeader::begBurstTimeMsec ( ) const [inline]

Returns the begin burst time (msec)

Definition at line 63 of file EcalTBEventHeader.h.

References begBurstTime_msec_.

Referenced by setBegBurstTimeMsec().

                              {
    return begBurstTime_msec_;
  }
int EcalTBEventHeader::begBurstTimeSec ( ) const [inline]

Returns the begin burst time (sec)

Definition at line 58 of file EcalTBEventHeader.h.

References begBurstTime_sec_.

Referenced by EcalStatusAnalyzer::analyze(), and setBegBurstTimeSec().

                             {
    return begBurstTime_sec_;
  }
short EcalTBEventHeader::burstNumber ( ) const [inline]

Returns the burst number.

Definition at line 48 of file EcalTBEventHeader.h.

References burstNumber_.

Referenced by operator<<(), and setBurstNumber().

                           {
    return burstNumber_;
  }
int EcalTBEventHeader::crystalInBeam ( ) const [inline]

Returns the crystal which is being hit by the beam (in the internal SM numbering scheme)

Definition at line 109 of file EcalTBEventHeader.h.

References crystalInBeam_, and EBDetId::ic().

Referenced by EBBeamHodoTask::analyze(), EBBeamCaloTask::analyze(), EEBeamHodoTask::analyze(), EEBeamCaloTask::analyze(), setCrystalInBeam(), setNextCrystalInBeam(), and setNominalCrystalInBeam().

                            {
    return EBDetId(crystalInBeam_).ic();
  }
int EcalTBEventHeader::date ( ) const [inline]

Returns the date in Unix time.

Definition at line 102 of file EcalTBEventHeader.h.

References date_.

Referenced by setDate().

                   {
    return date_;
  }
int EcalTBEventHeader::dbEventType ( ) const

Returns the event type as in the H4ROOTDB.

Definition at line 49 of file EcalTBEventHeader.cc.

References eventType(), laserTypeName(), LGreen, LInfrared, and LRed.

Referenced by EcalTBTDCRecInfoAlgo::reconstruct().

                                        {
  std::string evtType = eventType();
  int ievtType = 0;
  if (evtType=="beam") ievtType = 1 ;
  if (evtType=="laser") ievtType = 2 ;
  if (evtType=="pedestal") ievtType = 1 ; // same as beam
  if (ievtType == 2) {
    LaserType laser_type = laserTypeName();
    //if (laser_type == EcalTBEventHeader::LBlue) ievtType += 0 ;
    if (laser_type == EcalTBEventHeader::LGreen) ievtType += 1 ;
    if (laser_type == EcalTBEventHeader::LInfrared) ievtType += 2 ;
    if (laser_type == EcalTBEventHeader::LRed) ievtType += 3 ;
  }
  return ievtType;
}
int EcalTBEventHeader::endBurstLV1A ( ) const [inline]

Returns the end burst time (sec)

Definition at line 83 of file EcalTBEventHeader.h.

References endBurstLV1A_.

Referenced by setEndBurstLV1A().

                          {
    return endBurstLV1A_;
  }
int EcalTBEventHeader::endBurstTimeMsec ( ) const [inline]

Returns the end burst time (msec)

Definition at line 73 of file EcalTBEventHeader.h.

References endBurstTime_msec_.

Referenced by setEndBurstTimeMsec().

                              {
    return endBurstTime_msec_;
  }
int EcalTBEventHeader::endBurstTimeSec ( ) const [inline]

Returns the end burst time (sec)

Definition at line 68 of file EcalTBEventHeader.h.

References endBurstTime_sec_.

Referenced by setEndBurstTimeSec().

                             {
    return endBurstTime_sec_;
  }
int EcalTBEventHeader::eventNumber ( ) const [inline]
std::string EcalTBEventHeader::eventType ( ) const

Return the event type: "beam", "laser", "pedestal". "error" or a number orresponding to the orginal eventype stored in the RRF.

Definition at line 7 of file EcalTBEventHeader.cc.

References i, m, and triggerMask_.

Referenced by dbEventType().

{
  // this piece of code was in TPilot (ievtype)
  int m = triggerMask_ & 0x00FFFF01; // bits 0, 8..23

  // this piece of code was in TPilot (numbit)
  int w = m ;
  int num = 0;
  if ( w < 0 ) {        //
    w &= 0x7FFFFFFF;    // CINT Error
    num++;              //
  }
  do { num += ( w & 0x1 ); } while ( (w >>= 1) != 0 );
  // end of numbit

  if (num != 1)  return std::string("error") ;

  char chEvtype[80] ;
  if ( m == 1 ) return std::string("beam") ; // Physics triggers
  for(int i=0;i<24;i++) {
    if ( ( m & 0x1 ) == 1 ) {
      sprintf(chEvtype, "%d", i) ;
      if (i==11) return std::string("pedestal") ;
      if (i==13) return std::string("laser") ;
      return std::string(chEvtype) ;
    }
    m >>= 1;
  }
  return std::string("error");

  //   // FIXME: to be uncommented with new rawroot
  //   int evtype = rawHeader->GetEventType() ;
  //   if (evtype == 0) return std::string("error") ;
  //   if (evtype == 1) return std::string("beam") ; 
  //   if (evtype == 11) return std::string("pedestal") ;
  //   if (evtype == 13) return std::string("laser") ;
  //   char chEvtype[80] ;
  //   sprintf(chEvtype, "%d", evtype) ;
  //   return std::string(chEvtype) ;
}
int EcalTBEventHeader::laserType ( ) const [inline]

return the event laser type

Definition at line 151 of file EcalTBEventHeader.h.

References laserType_.

Referenced by setLaserType().

                        {
    return laserType_; // returns wavelength
  }
LaserType EcalTBEventHeader::laserTypeName ( ) const [inline]

Definition at line 155 of file EcalTBEventHeader.h.

References laserType_, LBlue, LGreen, LInfrared, and LRed.

Referenced by dbEventType().

                                  {
    LaserType laser_type;
    switch(laserType_){
    case 440:  laser_type = LBlue;       break;
    case 495:  laser_type = LGreen;      break;
    case 709:  laser_type = LRed;        break;
    case 800:  laser_type = LInfrared;   break;
    default:   laser_type = LRed;        break;
    }
    return laser_type; // returns laserTypeName
  }
int EcalTBEventHeader::lightIntensity ( ) const [inline]

return the laser intensity

Definition at line 147 of file EcalTBEventHeader.h.

References lightIntensity_.

Referenced by setLightIntensity().

                             {
    return lightIntensity_;
  }
const std::vector<magnetsMeasurement_t>& EcalTBEventHeader::magnetMeasurements ( ) const [inline]

Definition at line 174 of file EcalTBEventHeader.h.

References magnetMeasurements_.

Referenced by setMagnetMeasurements().

{ return magnetMeasurements_; }
int EcalTBEventHeader::nextCrystalInBeam ( ) const [inline]

Definition at line 115 of file EcalTBEventHeader.h.

References EBDetId::ic(), and nextCrystalInBeam_.

                                {
    return EBDetId(nextCrystalInBeam_).ic();
  }
int EcalTBEventHeader::nominalCrystalInBeam ( ) const [inline]

Definition at line 112 of file EcalTBEventHeader.h.

References EBDetId::ic(), and nominalCrystalInBeam_.

int EcalTBEventHeader::numberOfMagnetMeasurements ( ) const [inline]

Definition at line 172 of file EcalTBEventHeader.h.

References numberOfMagnetMeasurements_.

Referenced by setNumberOfMagnetMeasurements().

unsigned int EcalTBEventHeader::phiTableIndex ( ) const [inline]

Returns the phi table index.

Definition at line 121 of file EcalTBEventHeader.h.

References phiTableIndex_.

Referenced by setPhiTableIndex().

{ return phiTableIndex_; }
int EcalTBEventHeader::runNumber ( ) const [inline]

Definition at line 43 of file EcalTBEventHeader.h.

References runNumber_.

Referenced by operator<<(), EcalTBTDCRecInfoAlgo::reconstruct(), and setRunNumber().

                       {
    return runNumber_;
  }
int EcalTBEventHeader::S6ADC ( ) const [inline]

returns S6 ADC value

Definition at line 168 of file EcalTBEventHeader.h.

References S6ADC_.

Referenced by setS6ADC().

                     { 
    return S6ADC_ ; 
    }
int EcalTBEventHeader::scaler ( int  scalerId) const [inline]

Definition at line 176 of file EcalTBEventHeader.h.

References scalers_.

                                  {
    if (scalerId < ((int) scalers_.size() ) )
      return scalers_[scalerId];
    else
      return -1;
  }
void EcalTBEventHeader::setBegBurstLV1A ( const int &  begBurstLV1A) [inline]
void EcalTBEventHeader::setBegBurstTimeMsec ( const int &  begBurstTimeMsec) [inline]
void EcalTBEventHeader::setBegBurstTimeSec ( const int &  begBurstTimeSec) [inline]
void EcalTBEventHeader::setBurstNumber ( const short &  burstNumber) [inline]
void EcalTBEventHeader::setCrystalInBeam ( const DetId crystalInBeam) [inline]
void EcalTBEventHeader::setDate ( const int &  date) [inline]

Definition at line 208 of file EcalTBEventHeader.h.

References date(), and date_.

{ date_=date; }
void EcalTBEventHeader::setEndBurstLV1A ( const int &  endBurstLV1A) [inline]
void EcalTBEventHeader::setEndBurstTimeMsec ( const int &  endBurstTimeMsec) [inline]
void EcalTBEventHeader::setEndBurstTimeSec ( const int &  endBurstTimeSec) [inline]
void EcalTBEventHeader::setEventNumber ( const int &  eventNumber) [inline]
void EcalTBEventHeader::setLaserType ( const int &  laserType) [inline]

Definition at line 228 of file EcalTBEventHeader.h.

References laserType(), and laserType_.

void EcalTBEventHeader::setLightIntensity ( const int &  lightIntensity) [inline]

Definition at line 226 of file EcalTBEventHeader.h.

References lightIntensity(), and lightIntensity_.

void EcalTBEventHeader::setMagnetMeasurements ( const std::vector< magnetsMeasurement_t > &  magnetMeasurements) [inline]
void EcalTBEventHeader::setNextCrystalInBeam ( const DetId crystalInBeam) [inline]
void EcalTBEventHeader::setNominalCrystalInBeam ( const DetId crystalInBeam) [inline]
void EcalTBEventHeader::setNumberOfMagnetMeasurements ( const int &  numberOfMagnetMeasurements) [inline]
void EcalTBEventHeader::setPhiTableIndex ( const unsigned int &  phiTableIndex) [inline]
void EcalTBEventHeader::setRunNumber ( const int &  runNumber) [inline]
void EcalTBEventHeader::setS6ADC ( const int &  S6ADC) [inline]

Definition at line 230 of file EcalTBEventHeader.h.

References S6ADC(), and S6ADC_.

Referenced by CamacTBDataFormatter::interpretRawData().

{ S6ADC_ = S6ADC ; }
void EcalTBEventHeader::setScalers ( const std::vector< int > &  scalers) [inline]

Definition at line 235 of file EcalTBEventHeader.h.

References scalers_.

Referenced by CamacTBDataFormatter::interpretRawData().

{ scalers_ = scalers; }
void EcalTBEventHeader::setSmInBeam ( const int &  smInBeam) [inline]

Definition at line 190 of file EcalTBEventHeader.h.

References smInBeam(), and smInBeam_.

void EcalTBEventHeader::setSyncError ( const bool &  syncError) [inline]

Definition at line 224 of file EcalTBEventHeader.h.

References syncError(), and syncError_.

Referenced by EcalSupervisorTBDataFormatter::interpretRawData().

void EcalTBEventHeader::setTableIsMoving ( const bool &  tableIsMoving) [inline]
void EcalTBEventHeader::setTableIsMovingAtBegSpill ( const bool &  tableIsMoving) [inline]
void EcalTBEventHeader::setThetaTableIndex ( const unsigned int &  thetaTableIndex) [inline]
void EcalTBEventHeader::setTriggerMask ( const int &  triggerMask) [inline]

Definition at line 194 of file EcalTBEventHeader.h.

References triggerMask(), and triggerMask_.

short EcalTBEventHeader::smInBeam ( ) const [inline]

Returns the burst number.

Definition at line 53 of file EcalTBEventHeader.h.

References smInBeam_.

Referenced by EcalStatusAnalyzer::analyze(), and setSmInBeam().

                         {
    return smInBeam_;
  }
bool EcalTBEventHeader::syncError ( ) const [inline]

is there any sync error

Definition at line 127 of file EcalTBEventHeader.h.

References syncError_.

Referenced by EBBeamCaloTask::analyze(), EEBeamCaloTask::analyze(), and setSyncError().

{ return syncError_; }
bool EcalTBEventHeader::tableIsMoving ( ) const [inline]
bool EcalTBEventHeader::tableIsMovingAtBegSpill ( ) const [inline]

Tell if the table is Moving At the begin of the spill (available in runs only after 1st August 06)

Definition at line 125 of file EcalTBEventHeader.h.

References tableIsMovingAtBegSpill_.

unsigned int EcalTBEventHeader::thetaTableIndex ( ) const [inline]

Returns the theta table index.

Definition at line 119 of file EcalTBEventHeader.h.

References thetaTableIndex_.

Referenced by setThetaTableIndex().

{ return thetaTableIndex_; }
int EcalTBEventHeader::triggerMask ( ) const [inline]

Returns the trigger mask.

Definition at line 97 of file EcalTBEventHeader.h.

References triggerMask_.

Referenced by setTriggerMask().

                          {
    return triggerMask_;
  }

Member Data Documentation

Definition at line 250 of file EcalTBEventHeader.h.

Referenced by begBurstLV1A(), and setBegBurstLV1A().

Definition at line 247 of file EcalTBEventHeader.h.

Referenced by begBurstTimeMsec(), and setBegBurstTimeMsec().

Information from the ecalSupervisor.

Definition at line 246 of file EcalTBEventHeader.h.

Referenced by begBurstTimeSec(), and setBegBurstTimeSec().

The number of the burst.

Definition at line 242 of file EcalTBEventHeader.h.

Referenced by burstNumber(), and setBurstNumber().

Information from the table Supervisor.

The current crystal hit by the beam

Definition at line 273 of file EcalTBEventHeader.h.

Referenced by crystalInBeam(), and setCrystalInBeam().

int EcalTBEventHeader::date_ [private]

The date when the run was taken.

Definition at line 270 of file EcalTBEventHeader.h.

Referenced by date(), and setDate().

Definition at line 251 of file EcalTBEventHeader.h.

Referenced by endBurstLV1A(), and setEndBurstLV1A().

Definition at line 249 of file EcalTBEventHeader.h.

Referenced by endBurstTimeMsec(), and setEndBurstTimeMsec().

Definition at line 248 of file EcalTBEventHeader.h.

Referenced by endBurstTimeSec(), and setEndBurstTimeSec().

The numner of the event.

Definition at line 240 of file EcalTBEventHeader.h.

Referenced by eventNumber(), and setEventNumber().

The laser type --see enum LaserType.

Definition at line 288 of file EcalTBEventHeader.h.

Referenced by laserType(), laserTypeName(), and setLaserType().

The light intensity.

Definition at line 287 of file EcalTBEventHeader.h.

Referenced by lightIntensity(), and setLightIntensity().

Definition at line 258 of file EcalTBEventHeader.h.

Referenced by magnetMeasurements(), and setMagnetMeasurements().

The nominal next crystal which should be hit by the beam.

Definition at line 275 of file EcalTBEventHeader.h.

Referenced by nextCrystalInBeam(), and setNextCrystalInBeam().

The nominal crystal which should be hit by the beam.

Definition at line 274 of file EcalTBEventHeader.h.

Referenced by nominalCrystalInBeam(), and setNominalCrystalInBeam().

Magnet currents.

Definition at line 257 of file EcalTBEventHeader.h.

Referenced by numberOfMagnetMeasurements(), and setNumberOfMagnetMeasurements().

unsigned int EcalTBEventHeader::phiTableIndex_ [private]

Phi table index (Y)

Definition at line 277 of file EcalTBEventHeader.h.

Referenced by phiTableIndex(), and setPhiTableIndex().

The number of the run.

Definition at line 241 of file EcalTBEventHeader.h.

Referenced by runNumber(), and setRunNumber().

ADC lecture of the S6 counter.

Definition at line 290 of file EcalTBEventHeader.h.

Referenced by S6ADC(), and setS6ADC().

std::vector<int> EcalTBEventHeader::scalers_ [private]

Definition at line 295 of file EcalTBEventHeader.h.

Referenced by scaler(), and setScalers().

Definition at line 292 of file EcalTBEventHeader.h.

Referenced by setSmInBeam(), and smInBeam().

Definition at line 284 of file EcalTBEventHeader.h.

Referenced by setSyncError(), and syncError().

Definition at line 279 of file EcalTBEventHeader.h.

Referenced by setTableIsMoving(), and tableIsMoving().

Definition at line 281 of file EcalTBEventHeader.h.

Referenced by setTableIsMovingAtBegSpill(), and tableIsMovingAtBegSpill().

unsigned int EcalTBEventHeader::thetaTableIndex_ [private]

Theta table index (X)

Definition at line 276 of file EcalTBEventHeader.h.

Referenced by setThetaTableIndex(), and thetaTableIndex().

The trigger mask.

Definition at line 254 of file EcalTBEventHeader.h.

Referenced by eventType(), setTriggerMask(), and triggerMask().