12 param_LogWeighted_ ( par.getParameter<bool>(
"LogWeighted")) ,
13 param_T0_barl_ ( par.getParameter<double>(
"T0_barl")) ,
14 param_T0_endc_ ( par.getParameter<double>(
"T0_endc")) ,
15 param_T0_endcPresh_ ( par.getParameter<double>(
"T0_endcPresh")) ,
16 param_W0_ ( par.getParameter<double>(
"W0")) ,
17 param_X0_ ( par.getParameter<double>(
"X0")) ,
52 throw(std::runtime_error(
"\n\nPositionCalc::Calculate_Location called uninitialized or wrong initialization.\n\n"));
55 if( 0 != iDetIds.size() &&
56 0 != iRecHits->
size() )
58 typedef std::vector<DetId> DetIdVec ;
61 detIds.reserve( iDetIds.size() ) ;
69 for( std::vector< std::pair<DetId, float> >::const_iterator
n ( iDetIds.begin() ) ;
n != iDetIds.end() ; ++
n )
71 const DetId dId ( (*n).first ) ;
75 if( iHit != endRecHits )
77 detIds.push_back( dId );
79 const double energy ( iHit->energy() ) ;
96 LogDebug(
"ZeroClusterEnergy") <<
"cluster with 0 energy: " << eTot
97 <<
", returning (0,0,0)";
106 for( uint32_t ic ( 0 ) ;
119 const double ctreta (center_cell->getPosition().eta());
126 const double preshowerStartEta = 1.653;
127 const int subdet = maxId.
subdetId();
129 ( ( ( preshowerStartEta < fabs( ctreta ) ) &&
130 ( ( ( 0 < ctreta ) &&
138 const float maxToFront ( center_cell->getPosition().mag() ) ;
141 double total_weight = 0;
147 for( DetIdVec::const_iterator
j ( detIds.begin() ) ;
j != detIds.end() ; ++
j )
151 const double e_j ( iR->energy() ) ;
165 const float depth ( maxDepth + maxToFront - cell->getPosition().mag() ) ;
168 dynamic_cast<const TruncatedPyramid*>( cell )->getPosition( depth ) );
170 xw += weight*pos.x() ;
171 yw += weight*pos.y() ;
172 zw += weight*pos.z() ;
auto zw(V v) -> Vec2< typenamestd::remove_reference< decltype(v[0])>::type >
std::vector< EcalRecHit >::const_iterator const_iterator
const PositionCalc & operator=(const PositionCalc &rhs)
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
double param_T0_endcPresh_
const T & max(const T &a, const T &b)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
const_iterator end() const
XYZPointD XYZPoint
point in space with cartesian internal representation
bool null() const
is this a null id ?
math::XYZPoint Calculate_Location(const std::vector< std::pair< DetId, float > > &iDetIds, const EcalRecHitCollection *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=0)
iterator find(key_type k)
const CaloSubdetectorGeometry * m_esGeom