158 double sCenergy = seedCluster->energy();
160 double scEta = seedCluster->eta();
162 double scz = sCposition.z();
163 double scr =
sqrt(
pow(sCposition.x(),2)+
pow(sCposition.y(),2));
165 double pT = sCenergy * seedCluster->position().rho()/
sqrt(seedCluster->x()*seedCluster->x()+seedCluster->y()*seedCluster->y()+seedCluster->z()*seedCluster->z());
167 double magneticField = 3.8;
170 double phiVsRSlope = -3.00e-3 * magneticField / pT / 2.;
175 GlobalPoint superCluster(sCposition.x(),sCposition.y(),sCposition.z());
176 double r0 = beamSpot.
perp();
177 double z0 = beamSpot.z();
184 int chargeHypothesis;
185 double chargeSelector = sCenergy - (int)sCenergy;
186 if(chargeSelector >= 0.5) chargeHypothesis = -1;
187 if(chargeSelector < 0.5) chargeHypothesis = 1;
191 double phiFake =
phiDiff(superCluster.phi(),chargeHypothesis * phiVsRSlope * (scr - rFake));
192 double zFake = (rFake*(scz-z0)-r0*scz+scr*z0)/(scr-r0);
193 double xFake = rFake *
cos(phiFake);
194 double yFake = rFake *
sin(phiFake);
210 std::vector<BarrelDetLayer*> tibLayers = gst->
tibLayers();
214 std::vector<ForwardDetLayer*> tecLayers;
215 std::vector<ForwardDetLayer*> tidLayers;
217 tecLayers = gst->negTecLayers();
218 tidLayers = gst->negTidLayers();
221 tecLayers = gst->posTecLayers();
222 tidLayers = gst->posTidLayers();
251 bool hasLay1Hit =
false;
252 bool hasLay2Hit =
false;
253 bool hasBackupHit =
false;
257 std::vector<TrajectoryMeasurement> tib1measurements;
259 std::vector<TrajectoryMeasurement> tib2measurements;
266 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tib1measurements.begin(); tmIter != tib1measurements.end(); ++ tmIter){
271 if(
preselection(position, superCluster, phiVsRSlope, 1)){
278 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tib2measurements.begin(); tmIter != tib2measurements.end(); ++ tmIter){
283 if(
preselection(position, superCluster, phiVsRSlope, 1)){
290 if(!(hasLay1Hit && hasLay2Hit)) useTID =
true;
292 std::vector<TrajectoryMeasurement> tid1measurements;
293 if(useDL.at(2) && useTID) tid1measurements = layerMeasurements.measurements(*tid1,initialTSOS,*
thePropagator,*
theEstimator);
294 std::vector<TrajectoryMeasurement> tid2measurements;
295 if(useDL.at(3) && useTID) tid2measurements = layerMeasurements.measurements(*tid2,initialTSOS,*
thePropagator,*
theEstimator);
296 std::vector<TrajectoryMeasurement> tid3measurements;
297 if(useDL.at(4) && useTID) tid3measurements = layerMeasurements.measurements(*tid3,initialTSOS,*
thePropagator,*
theEstimator);
299 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tid1measurements.begin(); tmIter != tid1measurements.end(); ++ tmIter){
305 if(
preselection(position, superCluster, phiVsRSlope, 2)){
316 if(
preselection(position, superCluster, phiVsRSlope, 4) && position.
perp() > 37.){
326 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tid2measurements.begin(); tmIter != tid2measurements.end(); ++ tmIter){
332 if(
preselection(position, superCluster, phiVsRSlope, 2)){
343 if(
preselection(position, superCluster, phiVsRSlope, 4) && position.
perp() > 37.){
353 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tid3measurements.begin(); tmIter != tid3measurements.end(); ++ tmIter){
359 if(
preselection(position, superCluster, phiVsRSlope, 2)){
370 if(
preselection(position, superCluster, phiVsRSlope, 4) && position.
perp() > 37.){
380 std::vector<TrajectoryMeasurement> tec1measurements;
382 std::vector<TrajectoryMeasurement> tec2measurements;
384 std::vector<TrajectoryMeasurement> tec3measurements;
387 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tec1measurements.begin(); tmIter != tec1measurements.end(); ++ tmIter){
393 if(
preselection(position, superCluster, phiVsRSlope, 3)){
404 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tec2measurements.begin(); tmIter != tec2measurements.end(); ++ tmIter){
410 if(
preselection(position, superCluster, phiVsRSlope, 3)){
421 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tec3measurements.begin(); tmIter != tec3measurements.end(); ++ tmIter){
427 if(
preselection(position, superCluster, phiVsRSlope, 3)){
437 if( hasLay1Hit && hasLay2Hit ){
439 for (std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit1 =
layer1Hits_.begin() ; hit1!=
layer1Hits_.end(); ++hit1) {
440 for (std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit2 =
layer2Hits_.begin() ; hit2!=
layer2Hits_.end(); ++hit2) {
459 seed.setCaloCluster(caloCluster) ;
476 if(hasLay1Hit && hasBackupHit && seedCounter == 0){
478 for (std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit1 =
layer1Hits_.begin() ; hit1!=
layer1Hits_.end(); ++hit1) {
493 outerHit=
new SiStripRecHit2D(*(dynamic_cast <const SiStripRecHit2D *> (*hit2) ) );
499 seed.setCaloCluster(caloCluster) ;
bool checkHitsAndTSOS(std::vector< const SiStripMatchedRecHit2D * >::const_iterator hit1, std::vector< const SiStripMatchedRecHit2D * >::const_iterator hit2, double scr, double scz, double pT, double scEta)
std::vector< bool > useDetLayer(double scEta)
Sin< T >::type sin(const T &t)
const MeasurementTracker * theMeasurementTracker
Chi2MeasurementEstimator * theEstimator
const SiStripMatchedRecHit2D * matchedHitConverter(ConstRecHitPointer crhp)
static int position[TOTALCHAMBERS][3]
virtual LocalPoint localPosition() const
PTrajectoryStateOnDet * pts_
PRecHitContainer recHits_
Cos< T >::type cos(const T &t)
const edm::EventSetup * theSetup
edm::ESHandle< TrackerGeometry > trackerGeometryHandle
PropagatorWithMaterial * thePropagator
bool preselection(GlobalPoint position, GlobalPoint superCluster, double phiVsRSlope, int hitLayer)
const SiStripRecHit2D * backupHitConverter(ConstRecHitPointer crhp)
bool altCheckHitsAndTSOS(std::vector< const SiStripMatchedRecHit2D * >::const_iterator hit1, std::vector< const SiStripRecHit2D * >::const_iterator hit2, double scr, double scz, double pT, double scEta)
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< const SiStripMatchedRecHit2D * > layer2Hits_
double phiDiff(double phi1, double phi2)
std::vector< BarrelDetLayer * > const & tibLayers() const
std::vector< const SiStripRecHit2D * > backupLayer2Hits_
DetId geographicalId() const
std::vector< const SiStripMatchedRecHit2D * > layer1Hits_
const GeometricSearchTracker * geometricSearchTracker() const
Power< A, B >::type pow(const A &a, const B &b)