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());
168 double magneticField = 3.8;
171 double phiVsRSlope = -3.00e-3 * magneticField / pT / 2.;
176 GlobalPoint superCluster(sCposition.x(),sCposition.y(),sCposition.z());
185 int chargeHypothesis;
186 double chargeSelector = sCenergy - (int)sCenergy;
187 if(chargeSelector >= 0.5) chargeHypothesis = -1;
188 if(chargeSelector < 0.5) chargeHypothesis = 1;
192 double phiFake =
phiDiff(superCluster.phi(),chargeHypothesis * phiVsRSlope * (scr - rFake));
193 double zFake = (rFake*(scz-z0)-r0*scz+scr*z0)/(scr-r0);
194 double xFake = rFake *
cos(phiFake);
195 double yFake = rFake *
sin(phiFake);
201 float nomField = bfield->nominalValue();
216 std::vector<BarrelDetLayer*> tibLayers = gst->tibLayers();
220 std::vector<ForwardDetLayer*> tecLayers;
221 std::vector<ForwardDetLayer*> tidLayers;
223 tecLayers = gst->negTecLayers();
224 tidLayers = gst->negTidLayers();
227 tecLayers = gst->posTecLayers();
228 tidLayers = gst->posTidLayers();
257 bool hasLay1Hit =
false;
258 bool hasLay2Hit =
false;
259 bool hasBackupHit =
false;
263 std::vector<TrajectoryMeasurement> tib1measurements;
265 std::vector<TrajectoryMeasurement> tib2measurements;
272 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tib1measurements.begin(); tmIter != tib1measurements.end(); ++ tmIter){
277 if(
preselection(position, superCluster, phiVsRSlope, 1)){
284 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tib2measurements.begin(); tmIter != tib2measurements.end(); ++ tmIter){
289 if(
preselection(position, superCluster, phiVsRSlope, 1)){
296 if(!(hasLay1Hit && hasLay2Hit)) useTID =
true;
298 std::vector<TrajectoryMeasurement> tid1measurements;
299 if(useDL.at(2) && useTID) tid1measurements = layerMeasurements.measurements(*tid1,initialTSOS,*
thePropagator,*
theEstimator);
300 std::vector<TrajectoryMeasurement> tid2measurements;
301 if(useDL.at(3) && useTID) tid2measurements = layerMeasurements.measurements(*tid2,initialTSOS,*
thePropagator,*
theEstimator);
302 std::vector<TrajectoryMeasurement> tid3measurements;
303 if(useDL.at(4) && useTID) tid3measurements = layerMeasurements.measurements(*tid3,initialTSOS,*
thePropagator,*
theEstimator);
305 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tid1measurements.begin(); tmIter != tid1measurements.end(); ++ tmIter){
311 if(
preselection(position, superCluster, phiVsRSlope, 2)){
322 if(
preselection(position, superCluster, phiVsRSlope, 4) && position.
perp() > 37.){
332 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tid2measurements.begin(); tmIter != tid2measurements.end(); ++ tmIter){
338 if(
preselection(position, superCluster, phiVsRSlope, 2)){
349 if(
preselection(position, superCluster, phiVsRSlope, 4) && position.
perp() > 37.){
359 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tid3measurements.begin(); tmIter != tid3measurements.end(); ++ tmIter){
365 if(
preselection(position, superCluster, phiVsRSlope, 2)){
376 if(
preselection(position, superCluster, phiVsRSlope, 4) && position.
perp() > 37.){
386 std::vector<TrajectoryMeasurement> tec1measurements;
388 std::vector<TrajectoryMeasurement> tec2measurements;
390 std::vector<TrajectoryMeasurement> tec3measurements;
393 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tec1measurements.begin(); tmIter != tec1measurements.end(); ++ tmIter){
399 if(
preselection(position, superCluster, phiVsRSlope, 3)){
410 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tec2measurements.begin(); tmIter != tec2measurements.end(); ++ tmIter){
416 if(
preselection(position, superCluster, phiVsRSlope, 3)){
427 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tec3measurements.begin(); tmIter != tec3measurements.end(); ++ tmIter){
433 if(
preselection(position, superCluster, phiVsRSlope, 3)){
443 if( hasLay1Hit && hasLay2Hit ){
445 for (std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit1 =
layer1Hits_.begin() ; hit1!=
layer1Hits_.end(); ++hit1) {
446 for (std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit2 =
layer2Hits_.begin() ; hit2!=
layer2Hits_.end(); ++hit2) {
456 SiStripMatchedRecHit2D *hit;
457 hit=
new SiStripMatchedRecHit2D(*(dynamic_cast <const SiStripMatchedRecHit2D *> (*hit1) ) );
459 hit=
new SiStripMatchedRecHit2D(*(dynamic_cast <const SiStripMatchedRecHit2D *> (*hit2) ) );
465 seed.setCaloCluster(caloCluster) ;
480 if(hasLay1Hit && hasBackupHit && seedCounter == 0){
482 for (std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit1 =
layer1Hits_.begin() ; hit1!=
layer1Hits_.end(); ++hit1) {
493 SiStripMatchedRecHit2D *innerHit;
494 innerHit=
new SiStripMatchedRecHit2D(*(dynamic_cast <const SiStripMatchedRecHit2D *> (*hit1) ) );
496 SiStripRecHit2D *outerHit;
497 outerHit=
new SiStripRecHit2D(*(dynamic_cast <const SiStripRecHit2D *> (*hit2) ) );
503 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]
PRecHitContainer recHits_
Cos< T >::type cos(const T &t)
Abs< T >::type abs(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)
PTrajectoryStateOnDet pts_
std::vector< const SiStripRecHit2D * > backupLayer2Hits_
std::vector< const SiStripMatchedRecHit2D * > layer1Hits_
Power< A, B >::type pow(const A &a, const B &b)