CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

EcalEndcapSimHitsValidation Class Reference

#include <EcalEndcapSimHitsValidation.h>

Inheritance diagram for EcalEndcapSimHitsValidation:
edm::EDAnalyzer edm::EDConsumerBase

List of all members.

Public Member Functions

 EcalEndcapSimHitsValidation (const edm::ParameterSet &ps)
 Constructor.
 ~EcalEndcapSimHitsValidation ()
 Destructor.

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze.
void beginJob ()
void endJob (void)

Private Types

typedef std::map< uint32_t,
float, std::less< uint32_t > > 
MapType

Private Member Functions

float eCluster2x2 (MapType &themap)
float eCluster4x4 (float e33, MapType &themap)
virtual float energyInMatrixEE (int nCellInX, int nCellInY, int centralX, int centralY, int centralZ, MapType &themap)
bool fillEEMatrix (int nCellInX, int nCellInY, int CentralX, int CentralY, int CentralZ, MapType &fillmap, MapType &themap)
std::vector< uint32_t > getIdsAroundMax (int nCellInX, int nCellInY, int centralX, int centralY, int centralZ, MapType &themap)
uint32_t getUnitWithMaxEnergy (MapType &themap)

Private Attributes

DQMStoredbe_
std::string EEHitsCollection
float eRLength [26]
std::string g4InfoLabel
MonitorElementmeEEcrystalEnergy2_
MonitorElementmeEEcrystalEnergy_
MonitorElementmeEEe16_
MonitorElementmeEEe16oe25_
MonitorElementmeEEe1_
MonitorElementmeEEe1oe25_
MonitorElementmeEEe1oe4_
MonitorElementmeEEe1oe9_
MonitorElementmeEEe25_
MonitorElementmeEEe4_
MonitorElementmeEEe4oe9_
MonitorElementmeEEe9_
MonitorElementmeEEe9oe16_
MonitorElementmeEEe9oe25_
MonitorElementmeEEHitEnergy2_
MonitorElementmeEEHitEnergy_
MonitorElementmeEEhitLog10Energy25Norm_
MonitorElementmeEEhitLog10Energy_
MonitorElementmeEEhitLog10EnergyNorm_
MonitorElementmeEELongitudinalShower_
MonitorElementmeEEzmCrystals_
MonitorElementmeEEzmHits_
MonitorElementmeEEzmOccupancy_
MonitorElementmeEEzpCrystals_
MonitorElementmeEEzpHits_
MonitorElementmeEEzpOccupancy_
int myEntries
std::string outputFile_
std::string ValidationCollection
bool verbose_

Detailed Description

Definition at line 36 of file EcalEndcapSimHitsValidation.h.


Member Typedef Documentation

typedef std::map<uint32_t,float,std::less<uint32_t> > EcalEndcapSimHitsValidation::MapType [private]

Definition at line 38 of file EcalEndcapSimHitsValidation.h.


Constructor & Destructor Documentation

EcalEndcapSimHitsValidation::EcalEndcapSimHitsValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 17 of file EcalEndcapSimHitsValidation.cc.

References dbe_, eRLength, edm::ParameterSet::getUntrackedParameter(), timingPdfMaker::histo, meEEcrystalEnergy2_, meEEcrystalEnergy_, meEEe16_, meEEe16oe25_, meEEe1_, meEEe1oe25_, meEEe1oe4_, meEEe1oe9_, meEEe25_, meEEe4_, meEEe4oe9_, meEEe9_, meEEe9oe16_, meEEe9oe25_, meEEHitEnergy2_, meEEHitEnergy_, meEEhitLog10Energy25Norm_, meEEhitLog10Energy_, meEEhitLog10EnergyNorm_, meEELongitudinalShower_, meEEzmCrystals_, meEEzmHits_, meEEzmOccupancy_, meEEzpCrystals_, meEEzpHits_, meEEzpOccupancy_, myEntries, cppFunctionSkipper::operator, and verbose_.

                                                                                 :
  g4InfoLabel(ps.getParameter<std::string>("moduleLabelG4")),
  EEHitsCollection(ps.getParameter<std::string>("EEHitsCollection")),
  ValidationCollection(ps.getParameter<std::string>("ValidationCollection")){   

  // verbosity switch
  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
 
  // get hold of back-end interface
  dbe_ = 0;
  dbe_ = edm::Service<DQMStore>().operator->();           
  if ( dbe_ ) {
    if ( verbose_ ) { dbe_->setVerbose(1); } 
    else            { dbe_->setVerbose(0); }
  }
                                                                                                            
  if ( dbe_ ) {
    if ( verbose_ ) dbe_->showDirStructure();
  }
 

  meEEzpHits_             = 0;
  meEEzmHits_             = 0;
  meEEzpCrystals_         = 0;
  meEEzmCrystals_         = 0;
  meEEzpOccupancy_        = 0;
  meEEzmOccupancy_        = 0;
  meEELongitudinalShower_ = 0;
  meEEHitEnergy_          = 0;
  meEEhitLog10Energy_       = 0;
  meEEhitLog10EnergyNorm_   = 0;
  meEEhitLog10Energy25Norm_ = 0;
  meEEHitEnergy2_         = 0;
  meEEcrystalEnergy_      = 0;
  meEEcrystalEnergy2_     = 0;

  meEEe1_  = 0;  
  meEEe4_  = 0;  
  meEEe9_  = 0;  
  meEEe16_ = 0; 
  meEEe25_ = 0; 

  meEEe1oe4_   = 0;  
  meEEe1oe9_   = 0;  
  meEEe4oe9_   = 0;  
  meEEe9oe16_  = 0;
  meEEe1oe25_  = 0;  
  meEEe9oe25_  = 0; 
  meEEe16oe25_ = 0;

  myEntries = 0;
  for ( int myStep = 0; myStep<26; myStep++) { eRLength[myStep] = 0.0; }

  Char_t histo[200];
 
  if ( dbe_ ) {
    dbe_->setCurrentFolder("EcalHitsV/EcalSimHitsValidation");
  
    sprintf (histo, "EE+ hits multiplicity" ) ;
    meEEzpHits_ = dbe_->book1D(histo, histo, 50, 0., 5000.) ; 

    sprintf (histo, "EE- hits multiplicity" ) ;
    meEEzmHits_ = dbe_->book1D(histo, histo, 50, 0., 5000.) ; 

    sprintf (histo, "EE+ crystals multiplicity" ) ;
    meEEzpCrystals_ = dbe_->book1D(histo, histo, 200, 0., 2000.) ; 

    sprintf (histo, "EE- crystals multiplicity" ) ;
    meEEzmCrystals_ = dbe_->book1D(histo, histo, 200, 0., 2000.) ; 

    sprintf (histo, "EE+ occupancy" ) ;
    meEEzpOccupancy_ = dbe_->book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
  
    sprintf (histo, "EE- occupancy" ) ;
    meEEzmOccupancy_ = dbe_->book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
  
    sprintf (histo, "EE longitudinal shower profile" ) ;
    meEELongitudinalShower_ = dbe_->bookProfile(histo, histo, 26,0,26, 100, 0, 20000);

    sprintf (histo, "EE hits energy spectrum" );
    meEEHitEnergy_ = dbe_->book1D(histo, histo, 4000, 0., 400.);

    sprintf (histo, "EE hits log10energy spectrum" );
    meEEhitLog10Energy_ = dbe_->book1D(histo, histo, 140, -10., 4.);

    sprintf (histo, "EE hits log10energy spectrum vs normalized energy" );
    meEEhitLog10EnergyNorm_ = dbe_->bookProfile(histo, histo, 140, -10., 4., 100, 0., 1.);

    sprintf (histo, "EE hits log10energy spectrum vs normalized energy25" );
    meEEhitLog10Energy25Norm_ = dbe_->bookProfile(histo, histo, 140, -10., 4., 100, 0., 1.);

    sprintf (histo, "EE hits energy spectrum 2" );
    meEEHitEnergy2_ = dbe_->book1D(histo, histo, 1000, 0., 0.001);

    sprintf (histo, "EE crystal energy spectrum" );
    meEEcrystalEnergy_ = dbe_->book1D(histo, histo, 5000, 0., 50.);

    sprintf (histo, "EE crystal energy spectrum 2" );
    meEEcrystalEnergy2_ = dbe_->book1D(histo, histo, 1000, 0., 0.001);

    sprintf (histo, "EE E1" ) ;
    meEEe1_ = dbe_->book1D(histo, histo, 400, 0., 400.);

    sprintf (histo, "EE E4" ) ;
    meEEe4_ = dbe_->book1D(histo, histo, 400, 0., 400.);

    sprintf (histo, "EE E9" ) ;
    meEEe9_ = dbe_->book1D(histo, histo, 400, 0., 400.);

    sprintf (histo, "EE E16" ) ;
    meEEe16_ = dbe_->book1D(histo, histo, 400, 0., 400.);

    sprintf (histo, "EE E25" ) ;
    meEEe25_ = dbe_->book1D(histo, histo, 400, 0., 400.);

    sprintf (histo, "EE E1oE4" ) ;
    meEEe1oe4_ = dbe_->book1D(histo, histo, 100, 0.4, 1.1);

    sprintf (histo, "EE E1oE9" ) ;
    meEEe1oe9_ = dbe_->book1D(histo, histo, 100, 0.4, 1.1);

    sprintf (histo, "EE E4oE9" ) ;
    meEEe4oe9_ = dbe_->book1D(histo, histo, 100, 0.4, 1.1);

    sprintf (histo, "EE E9oE16" ) ;
    meEEe9oe16_ = dbe_->book1D(histo, histo, 100, 0.4, 1.1);

    sprintf (histo, "EE E1oE25" ) ;
    meEEe1oe25_ = dbe_->book1D(histo, histo, 100, 0.4, 1.1);

    sprintf (histo, "EE E9oE25" ) ;
    meEEe9oe25_ = dbe_->book1D(histo, histo, 100, 0.4, 1.1);

    sprintf (histo, "EE E16oE25" ) ;
    meEEe16oe25_ = dbe_->book1D(histo, histo, 100, 0.4, 1.1);
  }
}
EcalEndcapSimHitsValidation::~EcalEndcapSimHitsValidation ( )

Destructor.

Definition at line 155 of file EcalEndcapSimHitsValidation.cc.

                                                         {

}

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 171 of file EcalEndcapSimHitsValidation.cc.

References eCluster2x2(), eCluster4x4(), EEHitsCollection, relval_parameters_module::energy, energyInMatrixEE(), eRLength, edm::EventID::event(), MonitorElement::Fill(), fillEEMatrix(), g4InfoLabel, edm::Event::getByLabel(), getIdsAroundMax(), getUnitWithMaxEnergy(), i, edm::EventBase::id(), edm::HandleBase::isValid(), EEDetId::ix(), EEDetId::iy(), j, LogDebug, Association::map, meEEcrystalEnergy2_, meEEcrystalEnergy_, meEEe16_, meEEe16oe25_, meEEe1_, meEEe1oe25_, meEEe1oe4_, meEEe1oe9_, meEEe25_, meEEe4_, meEEe4oe9_, meEEe9_, meEEe9oe16_, meEEe9oe25_, meEEHitEnergy2_, meEEHitEnergy_, meEEhitLog10Energy25Norm_, meEEhitLog10Energy_, meEEhitLog10EnergyNorm_, meEELongitudinalShower_, meEEzmCrystals_, meEEzmHits_, meEEzmOccupancy_, meEEzpCrystals_, meEEzpHits_, meEEzpOccupancy_, myEntries, MonitorElement::Reset(), edm::EventID::run(), ValidationCollection, and EEDetId::zside().

                                                                                  {

  edm::LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();
  
  edm::Handle<edm::PCaloHitContainer> EcalHitsEE;
  e.getByLabel(g4InfoLabel,EEHitsCollection,EcalHitsEE);

  // Do nothing if no EndCap data available
  if( ! EcalHitsEE.isValid() ) return;

  edm::Handle<PEcalValidInfo> MyPEcalValidInfo;
  e.getByLabel(g4InfoLabel,ValidationCollection,MyPEcalValidInfo);

  std::vector<PCaloHit> theEECaloHits;
  theEECaloHits.insert(theEECaloHits.end(), EcalHitsEE->begin(), EcalHitsEE->end());
  
  myEntries++;

  std::map<unsigned int, std::vector<PCaloHit*>,std::less<unsigned int> > CaloHitMap;
  
  double EEetzp_ = 0.;
  double EEetzm_ = 0.;
  
  double ee1  = 0.0;
  double ee4  = 0.0;
  double ee9  = 0.0;
  double ee16 = 0.0;
  double ee25 = 0.0;
  std::vector<double> econtr(140, 0. );
  std::vector<double> econtr25(140, 0. );
  
  MapType eemap;
  MapType eemapzp;
  MapType eemapzm;
  uint32_t nEEzpHits = 0;
  uint32_t nEEzmHits = 0;
  
  for (std::vector<PCaloHit>::iterator isim = theEECaloHits.begin();
       isim != theEECaloHits.end(); ++isim){

    if ( isim->time() > 500. ) { continue; }

    CaloHitMap[ isim->id()].push_back(&(*isim));
    
    EEDetId eeid (isim->id()) ;
    
    LogDebug("HitInfo") 
      << " CaloHit " << isim->getName() << "\n" 
      << " DetID = "<<isim->id()<< " EEDetId = " << eeid.ix() << " " << eeid.iy() << "\n"       
      << " Time = " << isim->time() << "\n"
      << " Track Id = " << isim->geantTrackId() << "\n"
      << " Energy = " << isim->energy();
    
    uint32_t crystid = eeid.rawId();
     
    if (eeid.zside() > 0 ) {
      nEEzpHits++;
      EEetzp_ += isim->energy();
      eemapzp[crystid] += isim->energy();
      if (meEEzpOccupancy_) meEEzpOccupancy_->Fill(eeid.ix(), eeid.iy());
    }
    else if (eeid.zside() < 0 ) {
      nEEzmHits++;
      EEetzm_ += isim->energy();
      eemapzm[crystid] += isim->energy();
      if (meEEzmOccupancy_) meEEzmOccupancy_->Fill(eeid.ix(), eeid.iy());
    }

    if (meEEHitEnergy_) meEEHitEnergy_->Fill(isim->energy());
    if( isim->energy() > 0 ) {
      if( meEEhitLog10Energy_ ) meEEhitLog10Energy_->Fill(log10(isim->energy()));
      int log10i = int( ( log10(isim->energy()) + 10. ) * 10. );
      if( log10i >=0 && log10i < 140 ) econtr[log10i] += isim->energy();
    }
    if (meEEHitEnergy2_) meEEHitEnergy2_->Fill(isim->energy());
    eemap[crystid] += isim->energy();


  }
  
  if (meEEzpCrystals_) meEEzpCrystals_->Fill(eemapzp.size());
  if (meEEzmCrystals_) meEEzmCrystals_->Fill(eemapzm.size());
  
  if (meEEcrystalEnergy_) {
    for (std::map<uint32_t,float,std::less<uint32_t> >::iterator it = eemap.begin(); it != eemap.end(); ++it ) meEEcrystalEnergy_->Fill((*it).second);
  }
  if (meEEcrystalEnergy2_) {
    for (std::map<uint32_t,float,std::less<uint32_t> >::iterator it = eemap.begin(); it != eemap.end(); ++it ) meEEcrystalEnergy2_->Fill((*it).second);
  }
    
  if (meEEzpHits_)    meEEzpHits_->Fill(nEEzpHits);
  if (meEEzmHits_)    meEEzmHits_->Fill(nEEzmHits);
    
  
  int nEEHits = nEEzmHits + nEEzpHits;
  if (nEEHits > 0) {
    
    uint32_t  eecenterid = getUnitWithMaxEnergy(eemap);
    EEDetId myEEid(eecenterid);
    int bx = myEEid.ix();
    int by = myEEid.iy();
    int bz = myEEid.zside();
    ee1 =  energyInMatrixEE(1,1,bx,by,bz,eemap);
    if (meEEe1_) meEEe1_->Fill(ee1);
    ee9 =  energyInMatrixEE(3,3,bx,by,bz,eemap);
    if (meEEe9_) meEEe9_->Fill(ee9);
    ee25=  energyInMatrixEE(5,5,bx,by,bz,eemap);
    if (meEEe25_) meEEe25_->Fill(ee25);
    
    std::vector<uint32_t> ids25; ids25 = getIdsAroundMax(5,5,bx,by,bz,eemap);

    for( unsigned i=0; i<25; i++ ) {
      for( unsigned int j=0; j<CaloHitMap[ids25[i]].size(); j++ ) {
        if( CaloHitMap[ids25[i]][j]->energy() > 0 ) {
          int log10i = int( ( log10( CaloHitMap[ids25[i]][j]->energy()) + 10. ) * 10. );
          if( log10i >=0 && log10i < 140 ) econtr25[log10i] += CaloHitMap[ids25[i]][j]->energy();
        }
      }
    }

    MapType  neweemap;
    if( fillEEMatrix(3,3,bx,by,bz,neweemap, eemap)){
      ee4 = eCluster2x2(neweemap);
      if (meEEe4_) meEEe4_->Fill(ee4);
    }
    if( fillEEMatrix(5,5,bx,by,bz,neweemap, eemap)){
      ee16 = eCluster4x4(ee9,neweemap); 
      if (meEEe16_) meEEe16_->Fill(ee16);
    }
    
    if (meEEe1oe4_   && ee4  > 0.1 ) meEEe1oe4_  ->Fill(ee1/ee4);
    if (meEEe1oe9_   && ee9  > 0.1 ) meEEe1oe9_  ->Fill(ee1/ee9);
    if (meEEe4oe9_   && ee9  > 0.1 ) meEEe4oe9_  ->Fill(ee4/ee9);
    if (meEEe9oe16_  && ee16 > 0.1 ) meEEe9oe16_ ->Fill(ee9/ee16);
    if (meEEe16oe25_ && ee25 > 0.1 ) meEEe16oe25_->Fill(ee16/ee25);
    if (meEEe1oe25_  && ee25 > 0.1 ) meEEe1oe25_ ->Fill(ee1/ee25);
    if (meEEe9oe25_  && ee25 > 0.1 ) meEEe9oe25_ ->Fill(ee9/ee25);

    if( meEEhitLog10EnergyNorm_ && (EEetzp_+EEetzm_) != 0 ) {
      for( int i=0; i<140; i++ ) {
        meEEhitLog10EnergyNorm_->Fill( -10.+(float(i)+0.5)/10., econtr[i]/(EEetzp_+EEetzm_) );
      }
    }

    if( meEEhitLog10Energy25Norm_ && ee25 != 0 ) {
      for( int i=0; i<140; i++ ) {
        meEEhitLog10Energy25Norm_->Fill( -10.+(float(i)+0.5)/10., econtr25[i]/ee25 );
      }
    }
    
  }
    
  if( MyPEcalValidInfo.isValid() ) {
    if ( MyPEcalValidInfo->ee1x1() > 0. ) {
      std::vector<float>  EX0 = MyPEcalValidInfo->eX0();
      if (meEELongitudinalShower_) meEELongitudinalShower_->Reset();
      for (int myStep=0; myStep< 26; myStep++ ) { 
        eRLength[myStep] += EX0[myStep]; 
        if (meEELongitudinalShower_) meEELongitudinalShower_->Fill(float(myStep), eRLength[myStep]/myEntries);
      }
    }
  }
}
void EcalEndcapSimHitsValidation::beginJob ( void  ) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 159 of file EcalEndcapSimHitsValidation.cc.

                                          {

}
float EcalEndcapSimHitsValidation::eCluster2x2 ( MapType themap) [private]

Definition at line 429 of file EcalEndcapSimHitsValidation.cc.

Referenced by analyze().

                                                              {
  float  E22=0.;
  float e012  = themap[0]+themap[1]+themap[2];
  float e036  = themap[0]+themap[3]+themap[6];
  float e678  = themap[6]+themap[7]+themap[8];
  float e258  = themap[2]+themap[5]+themap[8];

  if ( (e012>e678 || e012==e678) && (e036>e258  || e036==e258))
    return     E22=themap[0]+themap[1]+themap[3]+themap[4];
  else if ( (e012>e678 || e012==e678)  && (e036<e258 || e036==e258) )
    return    E22=themap[1]+themap[2]+themap[4]+themap[5];
  else if ( (e012<e678 || e012==e678) && (e036>e258 || e036==e258))
    return     E22=themap[3]+themap[4]+themap[6]+themap[7];
  else if ( (e012<e678|| e012==e678)  && (e036<e258|| e036==e258) )
    return    E22=themap[4]+themap[5]+themap[7]+themap[8];
  else {
    return E22;
  }
}
float EcalEndcapSimHitsValidation::eCluster4x4 ( float  e33,
MapType themap 
) [private]

Definition at line 449 of file EcalEndcapSimHitsValidation.cc.

Referenced by analyze().

                                                                          {
  float E44=0.;
  float e0_4   = themap[0]+themap[1]+themap[2]+themap[3]+themap[4];
  float e0_20  = themap[0]+themap[5]+themap[10]+themap[15]+themap[20];
  float e4_24  = themap[4]+themap[9]+themap[14]+themap[19]+themap[24];
  float e0_24  = themap[20]+themap[21]+themap[22]+themap[23]+themap[24];
  
  if ((e0_4>e0_24 || e0_4==e0_24) && (e0_20>e4_24|| e0_20==e4_24))
    return E44=e33+themap[0]+themap[1]+themap[2]+themap[3]+themap[5]+themap[10]+themap[15];
  else if ((e0_4>e0_24 || e0_4==e0_24)  && (e0_20<e4_24 || e0_20==e4_24))
    return E44=e33+themap[1]+themap[2]+themap[3]+themap[4]+themap[9]+themap[14]+themap[19];
  else if ((e0_4<e0_24|| e0_4==e0_24) && (e0_20>e4_24 || e0_20==e4_24))
    return E44=e33+themap[5]+themap[10]+themap[15]+themap[20]+themap[21]+themap[22]+themap[23];
  else if ((e0_4<e0_24|| e0_4==e0_24) && (e0_20<e4_24 || e0_20==e4_24))
    return E44=e33+themap[21]+themap[22]+themap[23]+themap[24]+themap[9]+themap[14]+themap[19];
  else{
    return E44;
  }
}
void EcalEndcapSimHitsValidation::endJob ( void  ) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 163 of file EcalEndcapSimHitsValidation.cc.

                                        {

  //for ( int myStep = 0; myStep<26; myStep++){
  //  if (meEELongitudinalShower_) meEELongitudinalShower_->Fill(float(myStep), eRLength[myStep]/myEntries);
  //}

}
float EcalEndcapSimHitsValidation::energyInMatrixEE ( int  nCellInX,
int  nCellInY,
int  centralX,
int  centralY,
int  centralZ,
MapType themap 
) [private, virtual]

Definition at line 335 of file EcalEndcapSimHitsValidation.cc.

References getHLTprescales::index, LogDebug, DetId::rawId(), and EEDetId::validDetId().

Referenced by analyze().

                                                                      {
  
  int   ncristals   = 0;
  float totalEnergy = 0.;
        
  int goBackInX = nCellInX/2;
  int goBackInY = nCellInY/2;
  int startX    = centralX-goBackInX;
  int startY    = centralY-goBackInY;
  
  for (int ix=startX; ix<startX+nCellInX; ix++) {
    for (int iy=startY; iy<startY+nCellInY; iy++) {
      uint32_t index ;
      
      if(EEDetId::validDetId(ix,iy,centralZ)) {
        index = EEDetId(ix,iy,centralZ).rawId();
      }
      else { continue; }

      totalEnergy   += themap[index];
      ncristals     += 1;
    }
  }
  
  LogDebug("GeomInfo")
    << nCellInX << " x " << nCellInY 
    << " EE matrix energy = " << totalEnergy
    << " for " << ncristals << " crystals";
  return totalEnergy;
  
}
bool EcalEndcapSimHitsValidation::fillEEMatrix ( int  nCellInX,
int  nCellInY,
int  CentralX,
int  CentralY,
int  CentralZ,
MapType fillmap,
MapType themap 
) [private]

Definition at line 396 of file EcalEndcapSimHitsValidation.cc.

References getUnitWithMaxEnergy(), i, getHLTprescales::index, DetId::rawId(), and EEDetId::validDetId().

Referenced by analyze().

{
   int goBackInX = nCellInX/2;
   int goBackInY = nCellInY/2;

   int startX  =  CentralX - goBackInX;
   int startY  =  CentralY - goBackInY;

   int i = 0 ;
   for ( int ix = startX; ix < startX+nCellInX; ix ++ ) {

      for( int iy = startY; iy < startY + nCellInY; iy++ ) {

        uint32_t index ;

        if(EEDetId::validDetId(ix,iy,CentralZ)) {
          index = EEDetId(ix,iy,CentralZ).rawId();
        }
        else { continue; }
        fillmap[i++] = themap[index];
      }
   }
   uint32_t  centerid = getUnitWithMaxEnergy(themap);

   if ( fillmap[i/2] == themap[centerid] ) 
        return true;
   else
        return false;
}
std::vector< uint32_t > EcalEndcapSimHitsValidation::getIdsAroundMax ( int  nCellInX,
int  nCellInY,
int  centralX,
int  centralY,
int  centralZ,
MapType themap 
) [private]

Definition at line 369 of file EcalEndcapSimHitsValidation.cc.

References getHLTprescales::index, DetId::rawId(), and EEDetId::validDetId().

Referenced by analyze().

                                                                                                                                                      {
  
  int   ncristals   = 0;
  std::vector<uint32_t> ids( nCellInX*nCellInY );
        
  int goBackInX = nCellInX/2;
  int goBackInY = nCellInY/2;
  int startX    = centralX-goBackInX;
  int startY    = centralY-goBackInY;
  
  for (int ix=startX; ix<startX+nCellInX; ix++) {
    for (int iy=startY; iy<startY+nCellInY; iy++) {
      uint32_t index ;
      
      if(EEDetId::validDetId(ix,iy,centralZ)) {
        index = EEDetId(ix,iy,centralZ).rawId();
      }
      else { continue; }

      ids[ncristals] = index;
      ncristals     += 1;
    }
  }
  
  return ids;
}
uint32_t EcalEndcapSimHitsValidation::getUnitWithMaxEnergy ( MapType themap) [private]

Definition at line 469 of file EcalEndcapSimHitsValidation.cc.

References LogDebug.

Referenced by analyze(), and fillEEMatrix().

                                                                          {
  
  //look for max
  uint32_t unitWithMaxEnergy = 0;
  float    maxEnergy = 0.;
  
  MapType::iterator iter;
  for (iter = themap.begin(); iter != themap.end(); iter++) {
    
    if (maxEnergy < (*iter).second) {
      maxEnergy = (*iter).second;       
      unitWithMaxEnergy = (*iter).first;
    }                           
  }
  
  LogDebug("GeomInfo")
    << " max energy of " << maxEnergy 
    << " GeV in Unit id " << unitWithMaxEnergy;
  return unitWithMaxEnergy;
}

Member Data Documentation

Definition at line 84 of file EcalEndcapSimHitsValidation.h.

Referenced by EcalEndcapSimHitsValidation().

Definition at line 79 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze().

Definition at line 89 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 78 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze().

Definition at line 114 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 113 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 119 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 128 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 116 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 126 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 122 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 123 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 120 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 117 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 124 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 118 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 125 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 127 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 111 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 102 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 108 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 104 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 106 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 100 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 95 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 92 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 98 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 94 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 91 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 97 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 88 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

Definition at line 86 of file EcalEndcapSimHitsValidation.h.

Definition at line 80 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze().

Definition at line 82 of file EcalEndcapSimHitsValidation.h.

Referenced by EcalEndcapSimHitsValidation().