CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

EcalABAnalyzer Class Reference

#include <EcalABAnalyzer.h>

Inheritance diagram for EcalABAnalyzer:
edm::EDAnalyzer

List of all members.

Public Types

enum  VarCol { iBlue, iRed, nColor }

Public Member Functions

virtual void analyze (const edm::Event &e, const edm::EventSetup &c)
virtual void beginJob ()
 EcalABAnalyzer (const edm::ParameterSet &iConfig)
virtual void endJob ()
 ~EcalABAnalyzer ()

Private Attributes

double _alpha
double _beta
double _chi2cut
int _debug
std::string _ecalPart
int _fedid
unsigned int _firstsample
bool _fitab
unsigned int _lastsample
unsigned int _nevtmax
unsigned int _niter
double _noise
unsigned int _nsamples
unsigned int _presample
double _presamplecut
double _qualpercent
double _ratiomaxcutlow
double _ratiomincuthigh
double _ratiomincutlow
unsigned int _timingcuthigh
unsigned int _timingcutlow
unsigned int _timingqualhigh
unsigned int _timingquallow
double adc [10]
int adcG [10]
std::string alphafile
std::string alphainitfile
TAPDPulseAPDPulse
int channelIteratorEE
std::map< int, int > channelMapEE
int color
std::vector< int > colors
int dccID
std::vector< int > dccMEM
TMomDelta01
TMomDelta12
std::string digiCollection_
std::string digiProducer_
bool doesABTreeExist
int eta
int event
std::string eventHeaderCollection_
std::string eventHeaderProducer_
int fedID
int iChannelID [NCRYSEB]
int idccID [NCRYSEB]
int iEta [NCRYSEB]
int iEvent
int iPhi [NCRYSEB]
bool isGainOK
int iside [NCRYSEB]
bool isTimingOK
int iTowerID [NCRYSEB]
int iZ
int lightside
std::vector< int > modules
unsigned int nCrys
unsigned int nevtAB [NCRYSEB]
int nEvtBadGain [NCRYSEB]
int nEvtBadTiming [NCRYSEB]
int nEvtTot [NCRYSEB]
int phi
std::string resdir_
int runNum
int runType
TShapeAnalysisshapana
int side
bool wasGainOK [NCRYSEB]
bool wasTimingOK [NCRYSEB]

Detailed Description

Definition at line 35 of file EcalABAnalyzer.h.


Member Enumeration Documentation

Enumerator:
iBlue 
iRed 
nColor 

Definition at line 48 of file EcalABAnalyzer.h.

{ iBlue, iRed, nColor }; 

Constructor & Destructor Documentation

EcalABAnalyzer::EcalABAnalyzer ( const edm::ParameterSet iConfig) [explicit]

Definition at line 54 of file EcalABAnalyzer.cc.

References _ecalPart, _fedid, _firstsample, _fitab, _lastsample, _nsamples, _presample, _ratiomaxcutlow, _ratiomincuthigh, _ratiomincutlow, _timingcuthigh, _timingcutlow, _timingqualhigh, _timingquallow, APDPulse, Delta01, Delta12, digiCollection_, digiProducer_, eventHeaderCollection_, eventHeaderProducer_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), iChannelID, idccID, iEta, iPhi, isGainOK, iside, isTimingOK, iTowerID, iZ, j, nCrys, NCRYSEB, NCRYSEE, nevtAB, resdir_, wasGainOK, and wasTimingOK.

  :
iEvent(0),

// framework parameters with default values
_nsamples(        iConfig.getUntrackedParameter< unsigned int >( "nSamples",           10 ) ),
_presample(       iConfig.getUntrackedParameter< unsigned int >( "nPresamples",         2 ) ),
_firstsample(     iConfig.getUntrackedParameter< unsigned int >( "firstSample",         1 ) ),
_lastsample(      iConfig.getUntrackedParameter< unsigned int >( "lastSample",          2 ) ),
_timingcutlow(    iConfig.getUntrackedParameter< unsigned int >( "timingCutLow",        2 ) ),
_timingcuthigh(   iConfig.getUntrackedParameter< unsigned int >( "timingCutHigh",       9 ) ),
_timingquallow(   iConfig.getUntrackedParameter< unsigned int >( "timingQualLow",       3 ) ),
_timingqualhigh(  iConfig.getUntrackedParameter< unsigned int >( "timingQualHigh",      8 ) ),
_ratiomincutlow(  iConfig.getUntrackedParameter< double       >( "ratioMinCutLow",    0.4 ) ),
_ratiomincuthigh( iConfig.getUntrackedParameter< double       >( "ratioMinCutHigh",  0.95 ) ),
_ratiomaxcutlow(  iConfig.getUntrackedParameter< double       >( "ratioMaxCutLow",    0.8 ) ),
_presamplecut(    iConfig.getUntrackedParameter< double       >( "presampleCut",      5.0 ) ),
_niter(           iConfig.getUntrackedParameter< unsigned int >( "nIter",               3 ) ),
_alpha(           iConfig.getUntrackedParameter< double       >( "alpha",       1.5076494 ) ),
_beta(            iConfig.getUntrackedParameter< double       >( "beta",        1.5136036 ) ),
_nevtmax(         iConfig.getUntrackedParameter< unsigned int >( "nEvtMax",           200 ) ),
_noise(           iConfig.getUntrackedParameter< double       >( "noise",             2.0 ) ),
_chi2cut(         iConfig.getUntrackedParameter< double       >( "chi2cut",         100.0 ) ), 
_ecalPart(        iConfig.getUntrackedParameter< std::string  >( "ecalPart",         "EB" ) ),
_qualpercent(     iConfig.getUntrackedParameter< double       >( "qualPercent",       0.2 ) ), 
_debug(           iConfig.getUntrackedParameter< int          >( "debug",              0  ) ), 
nCrys(                                                                               NCRYSEB),
runType(-1), runNum(0), fedID(-1), dccID(-1), side(2), lightside(2), iZ(1),
phi(-1), eta(-1), event(0), color(-1), channelIteratorEE(0)

  //========================================================================

{


  // Initialization from cfg file

  resdir_                 = iConfig.getUntrackedParameter<std::string>("resDir");

  digiCollection_         = iConfig.getParameter<std::string>("digiCollection");
  digiProducer_           = iConfig.getParameter<std::string>("digiProducer");

  eventHeaderCollection_  = iConfig.getParameter<std::string>("eventHeaderCollection");
  eventHeaderProducer_    = iConfig.getParameter<std::string>("eventHeaderProducer");



  // Geometrical constants initialization 


  if (_ecalPart == "EB") {
    nCrys    = NCRYSEB;
  } else {
    nCrys    = NCRYSEE;
  }
  iZ         =  1;
  if(_fedid <= 609 ) 
    iZ       = -1;
  
  for(unsigned int j=0;j<nCrys;j++){
    iEta[j]=-1;
    iPhi[j]=-1;
    iTowerID[j]=-1;
    iChannelID[j]=-1;
    idccID[j]=-1;
    iside[j]=-1;
    wasTimingOK[j]=true;
    wasGainOK[j]=true; 
    nevtAB[j]=0 ;
  }
  
  // Quality check flags
  
  isGainOK=true;
  isTimingOK=true;

  // Objects dealing with pulses

  APDPulse = new TAPDPulse(_nsamples, _presample, _firstsample, _lastsample, 
                           _timingcutlow, _timingcuthigh, _timingquallow, _timingqualhigh,
                           _ratiomincutlow,_ratiomincuthigh, _ratiomaxcutlow);


  // Objects needed for npresample calculation

  Delta01=new TMom();
  Delta12=new TMom();
  _fitab=true;

}
EcalABAnalyzer::~EcalABAnalyzer ( )

Definition at line 147 of file EcalABAnalyzer.cc.

                               {
  //========================================================================


  // do anything here that needs to be done at desctruction time
  // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

void EcalABAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 230 of file EcalABAnalyzer.cc.

References _ecalPart, _fedid, _fitab, _nevtmax, adc, adcG, TMom::addEntry(), APDPulse, edm::DataFrameContainer::begin(), edm::SortedCollection< T, SORT >::begin(), benchmark_cfg::cerr, EcalElectronicsId::channelId(), channelIteratorEE, channelMapEE, color, colors, gather_cfg::cout, dccID, Delta01, Delta12, digiCollection_, digiProducer_, doesABTreeExist, MEEBGeom::electronic_channel(), edm::DataFrameContainer::end(), edm::SortedCollection< T, SORT >::end(), eta, eventHeaderCollection_, eventHeaderProducer_, exception, fedID, spr::find(), edm::EventSetup::get(), edm::Event::getByLabel(), TAPDPulse::getDelta(), EcalElectronicsMapping::getElectronicsId(), ecalpyutils::hashedIndex(), i, iChannelID, idccID, iEta, iEvent, iPhi, iside, TAPDPulse::isPulseOK(), TAPDPulse::isTimingQualOK(), iTowerID, iZ, EcalDCCHeaderBlock::LASER_DELAY_SCAN, EcalDCCHeaderBlock::LASER_GAP, EcalDCCHeaderBlock::LASER_POWER_SCAN, EcalDCCHeaderBlock::LASER_STD, lightside, MEEBGeom::localCoord(), siStripFEDMonitor_P5_cff::Max, nCrys, nevtAB, nEvtBadGain, nEvtBadTiming, nEvtTot, phi, edm::ESHandle< T >::product(), edm::Handle< T >::product(), runNum, runType, TAPDPulse::setPulse(), shapana, side, strip(), EcalElectronicsId::stripId(), EcalElectronicsId::towerId(), EcalDCCHeaderBlock::EcalDCCEventSettings::wavelength, and EcalElectronicsId::xtalId().

                                                                         {
//========================================================================

  ++iEvent;
  
  // retrieving DCC header
  edm::Handle<EcalRawDataCollection> pDCCHeader;
  const  EcalRawDataCollection* DCCHeader=0;
  try {
    e.getByLabel(eventHeaderProducer_,eventHeaderCollection_, pDCCHeader);
    DCCHeader=pDCCHeader.product();
  }catch ( std::exception& ex ) {
    std::cerr << "Error! can't get the product retrieving DCC header" << eventHeaderCollection_.c_str() <<" "<< eventHeaderProducer_.c_str() << std::endl;
  }
  
  //retrieving crystal data from Event
  edm::Handle<EBDigiCollection>  pEBDigi;
  const  EBDigiCollection* EBDigi=0;
  edm::Handle<EEDigiCollection>  pEEDigi;
  const  EEDigiCollection* EEDigi=0;
  if (_ecalPart == "EB") {
    try {
      e.getByLabel(digiProducer_,digiCollection_, pEBDigi); 
      EBDigi=pEBDigi.product(); 
    }catch ( std::exception& ex ) {
      std::cerr << "Error! can't get the product retrieving EB crystal data " << digiCollection_.c_str() << std::endl;
    } 
  } else if (_ecalPart == "EE") {
    try {
      e.getByLabel(digiProducer_,digiCollection_, pEEDigi); 
      EEDigi=pEEDigi.product(); 
    }catch ( std::exception& ex ) {
      std::cerr << "Error! can't get the product retrieving EE crystal data " << digiCollection_.c_str() << std::endl;
    } 
  } else {
    std::cout <<" Wrong ecalPart in cfg file " << std::endl;
    return;
  }

  // retrieving electronics mapping
  edm::ESHandle< EcalElectronicsMapping > ecalmapping;
  const EcalElectronicsMapping* TheMapping=0; 
  try{
    c.get< EcalMappingRcd >().get(ecalmapping);
    TheMapping = ecalmapping.product();
  }catch ( std::exception& ex ) {
    std::cerr << "Error! can't get the product EcalMappingRcd"<< std::endl;
  }

  // =============================
  // Decode DCCHeader Information 
  // =============================
  

  for ( EcalRawDataCollection::const_iterator headerItr= DCCHeader->begin();headerItr != DCCHeader->end(); 
        ++headerItr ) {
    
    // Get run type and run number 

    int fed = headerItr->fedId();  
    if(fed!=_fedid && _fedid!=-999) continue; 
    
    runType=headerItr->getRunType();
    runNum=headerItr->getRunNumber();
    event=headerItr->getLV1();

    dccID=headerItr->getDccInTCCCommand();
    fedID=headerItr->fedId();  
    lightside=headerItr->getRtHalf();

    // Check fed corresponds to the DCC in TCC
    
    if( 600+dccID != fedID ) continue;

    // Cut on runType

    if(runType!=EcalDCCHeaderBlock::LASER_STD 
       && runType!=EcalDCCHeaderBlock::LASER_GAP 
       && runType!=EcalDCCHeaderBlock::LASER_POWER_SCAN 
       && runType!=EcalDCCHeaderBlock::LASER_DELAY_SCAN ) return; 
    
    // Retrieve laser color and event number
    
    EcalDCCHeaderBlock::EcalDCCEventSettings settings = headerItr->getEventSettings();
    color = settings.wavelength;
    if( color <0 ) return;

    std::vector<int>::iterator iter = find( colors.begin(), colors.end(), color );
    if( iter==colors.end() ){
      colors.push_back( color );
    }
  }
  

  // Cut on fedID

  if(fedID!=_fedid && _fedid!=-999) return; 
  

  // ===========================
  // Decode EBDigis Information
  // ===========================
  
  int  adcGain=0;
  
  if (EBDigi){
    
    // Loop on crystals
    //=================== 

    for ( EBDigiCollection::const_iterator digiItr= EBDigi->begin(); digiItr != EBDigi->end(); ++digiItr ) {  // Loop on crystals
      
      // Retrieve geometry
      //=================== 

      EBDetId id_crystal(digiItr->id()) ;
      EBDataFrame df( *digiItr );

      int etaG = id_crystal.ieta() ;  // global
      int phiG = id_crystal.iphi() ;  // global

      int etaL ;  // local
      int phiL ;  // local
      std::pair<int, int> LocalCoord=MEEBGeom::localCoord( etaG , phiG );
      
      etaL=LocalCoord.first ;
      phiL=LocalCoord.second ;
      
      eta = etaG;
      phi = phiG;

      side=MEEBGeom::side(etaG,phiG);
   
      // Recover the TT id and the electronic crystal numbering from EcalElectronicsMapping

      EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal);

      int towerID=elecid_crystal.towerId();
      int strip=elecid_crystal.stripId();
      int xtal=elecid_crystal.xtalId();
      int channelID=  5*(strip-1) + xtal-1; 
      
      unsigned int channel=MEEBGeom::electronic_channel( etaL, phiL );

      assert( channel < nCrys );
      
      iEta[channel]=eta;
      iPhi[channel]=phi;   
      iTowerID[channel]=towerID;
      iChannelID[channel]=channelID;
      idccID[channel]=dccID;
      iside[channel]=side;

      // APD Pulse
      //=========== 
      
      // Loop on adc samples 
      
      for (unsigned int i=0; i< (*digiItr).size() ; ++i ) {   

        EcalMGPASample samp_crystal(df.sample(i));
        adc[i]=samp_crystal.adc() ;    
        adcG[i]=samp_crystal.gainId();   
        adc[i]*=adcG[i];
        if (i==0) adcGain=adcG[i];
        if (i>0) adcGain=TMath::Max(adcG[i],adcGain);  
      }

      APDPulse->setPulse(adc);
      

      // Quality checks
      //================
      
      if(adcGain!=1) nEvtBadGain[channel]++;   
      if(!APDPulse->isTimingQualOK()) nEvtBadTiming[channel]++;
      nEvtTot[channel]++;


      // Fill if Pulse is fine
      //=======================
      
      if( APDPulse->isPulseOK() && lightside==side){
        
        Delta01->addEntry(APDPulse->getDelta(0,1));
        Delta12->addEntry(APDPulse->getDelta(1,2));
        
        if( nevtAB[channel] < _nevtmax && _fitab ){
          if(doesABTreeExist)  shapana -> putAllVals(channel, adc, eta, phi);   
          else shapana -> putAllVals(channel, adc, eta, phi, dccID, side, towerID, channelID);
          nevtAB[channel]++ ;
        }
      }
    }
    
  } else if (EEDigi) {
    
    // Loop on crystals
    //===================

    for ( EEDigiCollection::const_iterator digiItr= EEDigi->begin(); digiItr != EEDigi->end(); ++digiItr ) {  // Loop on crystals
      
      // Retrieve geometry
      //=================== 

      EEDetId id_crystal(digiItr->id()) ;
      EEDataFrame df( *digiItr );
      
      phi = id_crystal.ix() ; 
      eta = id_crystal.iy() ; 

      int iX = (phi-1)/5+1;
      int iY = (eta-1)/5+1;
  
      side=MEEEGeom::side( iX, iY ,iZ);       
      EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal);
      
      int towerID=elecid_crystal.towerId();
      int channelID=elecid_crystal.channelId()-1;  
      
      int hashedIndex=100000*eta+phi;
      
      if( channelMapEE.count(hashedIndex) == 0 ){
        channelMapEE[hashedIndex]=channelIteratorEE;
        channelIteratorEE++;
      }
      
      unsigned int channel=channelMapEE[hashedIndex];
     
      assert ( channel < nCrys );

      iEta[channel]=eta;
      iPhi[channel]=phi;
      iTowerID[channel]=towerID;
      iChannelID[channel]=channelID;
      idccID[channel]=dccID;
      iside[channel]=side;

      // APD Pulse
      //=========== 

      if( (*digiItr).size()>10) std::cout <<"SAMPLES SIZE > 10!" <<  (*digiItr).size()<< std::endl;
 
      // Loop on adc samples  

      for (unsigned int i=0; i< (*digiItr).size() ; ++i ) { 

        EcalMGPASample samp_crystal(df.sample(i));
        adc[i]=samp_crystal.adc() ;    
        adcG[i]=samp_crystal.gainId();   
        adc[i]*=adcG[i];
        
        if (i==0) adcGain=adcG[i];
        if (i>0) adcGain=TMath::Max(adcG[i],adcGain);  
      }
      
      APDPulse->setPulse(adc);

      // Quality checks
      //================
      
      if(adcGain!=1) nEvtBadGain[channel]++;   
      if(!APDPulse->isTimingQualOK()) nEvtBadTiming[channel]++;
      nEvtTot[channel]++;
      
      // Fill if Pulse is fine
      //=======================
      
      if( APDPulse->isPulseOK() && lightside==side){
        
        Delta01->addEntry(APDPulse->getDelta(0,1));
        Delta12->addEntry(APDPulse->getDelta(1,2));
        
        if( nevtAB[channel] < _nevtmax && _fitab ){
          if(doesABTreeExist)  shapana -> putAllVals(channel, adc, eta, phi);   
          else shapana -> putAllVals(channel, adc, eta, phi, dccID, side, towerID, channelID);  
          nevtAB[channel]++ ;
        }
      }
    }
  }
}// analyze
void EcalABAnalyzer::beginJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 159 of file EcalABAnalyzer.cc.

References _alpha, _beta, _chi2cut, _firstsample, _fitab, _lastsample, _nevtmax, _noise, _nsamples, _presample, alphafile, alphainitfile, doesABTreeExist, link(), prof2calltree::namefile, NULL, resdir_, shapana, and MultipleCompare::test.

                              {
  //========================================================================

  
  //Calculate alpha and beta


  // Define output results filenames and shape analyzer object (alpha,beta) 
  //=====================================================================
  
  // 1) AlphaBeta files
  
  doesABTreeExist=true;
  
  std::stringstream nameabinitfile;
  nameabinitfile << resdir_ <<"/ABInit.root";
  alphainitfile=nameabinitfile.str();
  
  std::stringstream nameabfile;  
  std::stringstream link;  
  nameabfile << resdir_ <<"/AB.root";
  
  FILE *test;
  test = fopen(nameabinitfile.str().c_str(),"r"); 
  if(test == NULL) {
    doesABTreeExist=false;
    _fitab=true;
  };
  delete test;

  
  TFile *fAB=0; TTree *ABInit=0;
  if(doesABTreeExist){
    fAB=new TFile(nameabinitfile.str().c_str());
  }
  if(doesABTreeExist && fAB){
    ABInit = (TTree*) fAB->Get("ABCol0");
  }
  
  // 2) Shape analyzer
  
  if(doesABTreeExist && fAB && ABInit && ABInit->GetEntries()!=0){
    shapana= new TShapeAnalysis(ABInit, _alpha, _beta, 5.5, 1.0);
    doesABTreeExist=true;
  }else{
    shapana= new TShapeAnalysis(_alpha, _beta, 5.5, 1.0);
    doesABTreeExist=false;
    _fitab=true;  
  }  
  shapana -> set_const(_nsamples,_firstsample,_lastsample,
                       _presample, _nevtmax, _noise, _chi2cut);
  
  if(doesABTreeExist && fAB ) fAB->Close();
  
  if(_fitab){
    alphafile=nameabfile.str();
  }else{
    alphafile=alphainitfile;
    link<< "ln -s "<<resdir_<<"/ABInit.root "<< resdir_<<"/AB.root";  
    system(link.str().c_str());
  }

  // Define output results files' names
  
  std::stringstream namefile;
  namefile << resdir_ <<"/AB.root";
  alphafile=namefile.str(); 

}
void EcalABAnalyzer::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 515 of file EcalABAnalyzer.cc.

References _ecalPart, _fitab, _presample, _presamplecut, _qualpercent, alphafile, alphainitfile, APDPulse, channelMapEE, TShapeAnalysis::computeShape(), gather_cfg::cout, Delta01, Delta12, doesABTreeExist, TMom::getMean(), i, isGainOK, isTimingOK, nCrys, nEvtBadGain, nEvtBadTiming, nEvtTot, TShapeAnalysis::set_nch(), TShapeAnalysis::set_presample(), TAPDPulse::setPresamples(), shapana, wasGainOK, and wasTimingOK.

                            {
//========================================================================

  std::cout <<  "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl;
  std::cout <<   "\t+=+     Analyzing data: getting (alpha, beta)     +=+" << std::endl;

  // Adjust channel numbers for EE 
  //===============================

  if( _ecalPart == "EE" ) {
    nCrys=channelMapEE.size();
    shapana->set_nch(nCrys);
  }
    

  // Set presamples number 
  //======================
  
  double delta01=Delta01->getMean();
  double delta12=Delta12->getMean();
  if(delta12>_presamplecut) {
    _presample=2;
    if(delta01>_presamplecut) _presample=1;
  }
  
  APDPulse->setPresamples(_presample);
  shapana->set_presample(_presample);

  //  Get alpha and beta
  //======================

  if(_fitab){
    std::cout <<  "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl;
    std::cout <<   "\t+=+     Analyzing data: getting (alpha, beta)     +=+" << std::endl;
    TFile *fAB=0; TTree *ABInit=0;
    if(doesABTreeExist){
      fAB=new TFile(alphainitfile.c_str());
    }
    if(doesABTreeExist && fAB){
      ABInit = (TTree*) fAB->Get("ABCol0");
    } 
    shapana->computeShape(alphafile, ABInit);

  // Set quality flags for gains and timing

  double BadGainEvtPercentage=0.0;
  double BadTimingEvtPercentage=0.0;
  
  int nChanBadGain=0;
  int nChanBadTiming=0;
  
  for (unsigned int i=0;i<nCrys;i++){
    if(nEvtTot[i]!=0){
      BadGainEvtPercentage=double(nEvtBadGain[i])/double(nEvtTot[i]);
      BadTimingEvtPercentage=double(nEvtBadTiming[i])/double(nEvtTot[i]);
    }
    if(BadGainEvtPercentage>_qualpercent) {
      wasGainOK[i]=false;
      nChanBadGain++;
    }
    if(BadTimingEvtPercentage>_qualpercent){
      wasTimingOK[i]=false;
      nChanBadTiming++;
    }
  }
  
  double BadGainChanPercentage=double(nChanBadGain)/double(nCrys);
  double BadTimingChanPercentage=double(nChanBadTiming)/double(nCrys);
  
  if(BadGainChanPercentage>_qualpercent) isGainOK = false;
  if(BadTimingChanPercentage>_qualpercent) isTimingOK = false;

  
  if( !isGainOK )
  std::cout <<    "\t+=+ ............................ WARNING! APD GAIN WAS NOT 1    +=+" << std::endl;
  if( !isTimingOK )
  std::cout <<    "\t+=+ ............................ WARNING! TIMING WAS BAD        +=+" << std::endl;

  std::cout <<    "\t+=+    .................................... done  +=+" << std::endl;
  std::cout <<    "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl;
  }
  

}

Member Data Documentation

double EcalABAnalyzer::_alpha [private]

Definition at line 70 of file EcalABAnalyzer.h.

Referenced by beginJob().

double EcalABAnalyzer::_beta [private]

Definition at line 71 of file EcalABAnalyzer.h.

Referenced by beginJob().

double EcalABAnalyzer::_chi2cut [private]

Definition at line 74 of file EcalABAnalyzer.h.

Referenced by beginJob().

int EcalABAnalyzer::_debug [private]

Definition at line 78 of file EcalABAnalyzer.h.

std::string EcalABAnalyzer::_ecalPart [private]

Definition at line 75 of file EcalABAnalyzer.h.

Referenced by analyze(), EcalABAnalyzer(), and endJob().

int EcalABAnalyzer::_fedid [private]

Definition at line 76 of file EcalABAnalyzer.h.

Referenced by analyze(), and EcalABAnalyzer().

unsigned int EcalABAnalyzer::_firstsample [private]

Definition at line 59 of file EcalABAnalyzer.h.

Referenced by beginJob(), and EcalABAnalyzer().

bool EcalABAnalyzer::_fitab [private]

Definition at line 104 of file EcalABAnalyzer.h.

Referenced by analyze(), beginJob(), EcalABAnalyzer(), and endJob().

unsigned int EcalABAnalyzer::_lastsample [private]

Definition at line 60 of file EcalABAnalyzer.h.

Referenced by beginJob(), and EcalABAnalyzer().

unsigned int EcalABAnalyzer::_nevtmax [private]

Definition at line 72 of file EcalABAnalyzer.h.

Referenced by analyze(), and beginJob().

unsigned int EcalABAnalyzer::_niter [private]

Definition at line 69 of file EcalABAnalyzer.h.

double EcalABAnalyzer::_noise [private]

Definition at line 73 of file EcalABAnalyzer.h.

Referenced by beginJob().

unsigned int EcalABAnalyzer::_nsamples [private]

Definition at line 57 of file EcalABAnalyzer.h.

Referenced by beginJob(), and EcalABAnalyzer().

unsigned int EcalABAnalyzer::_presample [private]

Definition at line 58 of file EcalABAnalyzer.h.

Referenced by beginJob(), EcalABAnalyzer(), and endJob().

Definition at line 68 of file EcalABAnalyzer.h.

Referenced by endJob().

double EcalABAnalyzer::_qualpercent [private]

Definition at line 77 of file EcalABAnalyzer.h.

Referenced by endJob().

Definition at line 67 of file EcalABAnalyzer.h.

Referenced by EcalABAnalyzer().

Definition at line 66 of file EcalABAnalyzer.h.

Referenced by EcalABAnalyzer().

Definition at line 65 of file EcalABAnalyzer.h.

Referenced by EcalABAnalyzer().

unsigned int EcalABAnalyzer::_timingcuthigh [private]

Definition at line 62 of file EcalABAnalyzer.h.

Referenced by EcalABAnalyzer().

unsigned int EcalABAnalyzer::_timingcutlow [private]

Definition at line 61 of file EcalABAnalyzer.h.

Referenced by EcalABAnalyzer().

unsigned int EcalABAnalyzer::_timingqualhigh [private]

Definition at line 64 of file EcalABAnalyzer.h.

Referenced by EcalABAnalyzer().

unsigned int EcalABAnalyzer::_timingquallow [private]

Definition at line 63 of file EcalABAnalyzer.h.

Referenced by EcalABAnalyzer().

double EcalABAnalyzer::adc[10] [private]

Definition at line 129 of file EcalABAnalyzer.h.

Referenced by analyze().

int EcalABAnalyzer::adcG[10] [private]

Definition at line 130 of file EcalABAnalyzer.h.

Referenced by analyze().

std::string EcalABAnalyzer::alphafile [private]

Definition at line 92 of file EcalABAnalyzer.h.

Referenced by beginJob(), and endJob().

std::string EcalABAnalyzer::alphainitfile [private]

Definition at line 93 of file EcalABAnalyzer.h.

Referenced by beginJob(), and endJob().

Definition at line 80 of file EcalABAnalyzer.h.

Referenced by analyze(), EcalABAnalyzer(), and endJob().

Definition at line 131 of file EcalABAnalyzer.h.

Referenced by analyze().

std::map<int, int> EcalABAnalyzer::channelMapEE [private]

Definition at line 119 of file EcalABAnalyzer.h.

Referenced by analyze(), and endJob().

int EcalABAnalyzer::color [private]

Definition at line 128 of file EcalABAnalyzer.h.

Referenced by analyze().

std::vector<int> EcalABAnalyzer::colors [private]

Definition at line 118 of file EcalABAnalyzer.h.

Referenced by analyze().

int EcalABAnalyzer::dccID [private]

Definition at line 110 of file EcalABAnalyzer.h.

Referenced by analyze().

std::vector<int> EcalABAnalyzer::dccMEM [private]

Definition at line 120 of file EcalABAnalyzer.h.

Definition at line 81 of file EcalABAnalyzer.h.

Referenced by analyze(), EcalABAnalyzer(), and endJob().

Definition at line 82 of file EcalABAnalyzer.h.

Referenced by analyze(), EcalABAnalyzer(), and endJob().

std::string EcalABAnalyzer::digiCollection_ [private]

Definition at line 85 of file EcalABAnalyzer.h.

Referenced by analyze(), and EcalABAnalyzer().

std::string EcalABAnalyzer::digiProducer_ [private]

Definition at line 86 of file EcalABAnalyzer.h.

Referenced by analyze(), and EcalABAnalyzer().

Definition at line 102 of file EcalABAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

int EcalABAnalyzer::eta [private]

Definition at line 126 of file EcalABAnalyzer.h.

Referenced by analyze().

int EcalABAnalyzer::event [private]

Definition at line 127 of file EcalABAnalyzer.h.

Definition at line 87 of file EcalABAnalyzer.h.

Referenced by analyze(), and EcalABAnalyzer().

std::string EcalABAnalyzer::eventHeaderProducer_ [private]

Definition at line 88 of file EcalABAnalyzer.h.

Referenced by analyze(), and EcalABAnalyzer().

int EcalABAnalyzer::fedID [private]

Definition at line 109 of file EcalABAnalyzer.h.

Referenced by analyze().

int EcalABAnalyzer::iChannelID[NCRYSEB] [private]

Definition at line 135 of file EcalABAnalyzer.h.

Referenced by analyze(), and EcalABAnalyzer().

int EcalABAnalyzer::idccID[NCRYSEB] [private]

Definition at line 135 of file EcalABAnalyzer.h.

Referenced by analyze(), and EcalABAnalyzer().

int EcalABAnalyzer::iEta[NCRYSEB] [private]

Definition at line 134 of file EcalABAnalyzer.h.

Referenced by analyze(), and EcalABAnalyzer().

int EcalABAnalyzer::iEvent [private]

Definition at line 52 of file EcalABAnalyzer.h.

Referenced by analyze().

int EcalABAnalyzer::iPhi[NCRYSEB] [private]

Definition at line 134 of file EcalABAnalyzer.h.

Referenced by analyze(), and EcalABAnalyzer().

bool EcalABAnalyzer::isGainOK [private]

Definition at line 146 of file EcalABAnalyzer.h.

Referenced by EcalABAnalyzer(), and endJob().

int EcalABAnalyzer::iside[NCRYSEB] [private]

Definition at line 135 of file EcalABAnalyzer.h.

Referenced by analyze(), and EcalABAnalyzer().

Definition at line 147 of file EcalABAnalyzer.h.

Referenced by EcalABAnalyzer(), and endJob().

int EcalABAnalyzer::iTowerID[NCRYSEB] [private]

Definition at line 135 of file EcalABAnalyzer.h.

Referenced by analyze(), and EcalABAnalyzer().

int EcalABAnalyzer::iZ [private]

Definition at line 113 of file EcalABAnalyzer.h.

Referenced by analyze(), and EcalABAnalyzer().

Definition at line 112 of file EcalABAnalyzer.h.

Referenced by analyze().

std::vector<int> EcalABAnalyzer::modules [private]

Definition at line 121 of file EcalABAnalyzer.h.

unsigned int EcalABAnalyzer::nCrys [private]

Definition at line 101 of file EcalABAnalyzer.h.

Referenced by analyze(), EcalABAnalyzer(), and endJob().

unsigned int EcalABAnalyzer::nevtAB[NCRYSEB] [private]

Definition at line 96 of file EcalABAnalyzer.h.

Referenced by analyze(), and EcalABAnalyzer().

int EcalABAnalyzer::nEvtBadGain[NCRYSEB] [private]

Definition at line 139 of file EcalABAnalyzer.h.

Referenced by analyze(), and endJob().

int EcalABAnalyzer::nEvtBadTiming[NCRYSEB] [private]

Definition at line 140 of file EcalABAnalyzer.h.

Referenced by analyze(), and endJob().

int EcalABAnalyzer::nEvtTot[NCRYSEB] [private]

Definition at line 141 of file EcalABAnalyzer.h.

Referenced by analyze(), and endJob().

int EcalABAnalyzer::phi [private]

Definition at line 126 of file EcalABAnalyzer.h.

Referenced by analyze().

std::string EcalABAnalyzer::resdir_ [private]

Definition at line 84 of file EcalABAnalyzer.h.

Referenced by beginJob(), and EcalABAnalyzer().

int EcalABAnalyzer::runNum [private]

Definition at line 108 of file EcalABAnalyzer.h.

Referenced by analyze().

int EcalABAnalyzer::runType [private]

Definition at line 107 of file EcalABAnalyzer.h.

Referenced by analyze().

Definition at line 95 of file EcalABAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

int EcalABAnalyzer::side [private]

Definition at line 111 of file EcalABAnalyzer.h.

Referenced by analyze().

bool EcalABAnalyzer::wasGainOK[NCRYSEB] [private]

Definition at line 143 of file EcalABAnalyzer.h.

Referenced by EcalABAnalyzer(), and endJob().

bool EcalABAnalyzer::wasTimingOK[NCRYSEB] [private]

Definition at line 144 of file EcalABAnalyzer.h.

Referenced by EcalABAnalyzer(), and endJob().