CMS 3D CMS Logo

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

PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo Class Reference

#include <PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h>

List of all members.

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup)
void clear ()
TrajectorySeedCollectiongetTrajectorySeedCollection ()
void init ()
 PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo (const edm::ParameterSet &)
 ~PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo ()

Private Types

typedef Regions::const_iterator IR
typedef std::vector
< TrackingRegion * > 
Regions

Private Member Functions

bool inspect (const TrackingRegion &region)
void loop ()

Private Attributes

const edm::ParameterSet _conf
edm::ParameterSet creatorPSet
edm::ParameterSet hitsfactoryPSet
const edm::EventSetupmyEsetup
const edm::EventmyEvent
PrintRecoObjects po
reco::Vertex primaryVertex
edm::ParameterSet regfactoryPSet
Regions regions
TrajectorySeedCollectionseedCollection
std::stringstream ss
ClusterChecker theClusterCheck
CombinedHitQuadrupletGeneratorForPhotonConversiontheHitsGenerator
GlobalTrackingRegionProducerFromBeamSpottheRegionProducer
SeedForPhotonConversionFromQuadrupletstheSeedCreator
bool theSilentOnClusterCheck
reco::VertexCollection vertexCollection
edm::Handle
< reco::VertexCollection
vertexHandle

Detailed Description

Definition at line 29 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.


Member Typedef Documentation

typedef Regions::const_iterator PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::IR [private]

Constructor & Destructor Documentation

PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo ( const edm::ParameterSet conf)

Definition at line 15 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

References init().

  :_conf(conf),seedCollection(0),
   hitsfactoryPSet(conf.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet")),   
   creatorPSet(conf.getParameter<edm::ParameterSet>("SeedCreatorPSet")),
   regfactoryPSet(conf.getParameter<edm::ParameterSet>("RegionFactoryPSet")),
   theClusterCheck(conf.getParameter<edm::ParameterSet>("ClusterCheckPSet")),
   theSilentOnClusterCheck(conf.getParameter<edm::ParameterSet>("ClusterCheckPSet").getUntrackedParameter<bool>("silentClusterCheck",false)){
  
  init();  
}
PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::~PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo ( ) [inline]

Member Function Documentation

void PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::analyze ( const edm::Event event,
const edm::EventSetup setup 
)

Definition at line 44 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

References _conf, event(), edm::ParameterSet::getParameter(), edm::HandleBase::isValid(), loop(), myEsetup, myEvent, po, PrintRecoObjects::print(), regions, GlobalTrackingRegionProducerFromBeamSpot::regions(), seedCollection, HcalObjRepresent::setup(), ss, theClusterCheck, theRegionProducer, theSilentOnClusterCheck, ClusterChecker::tooManyClusters(), and vertexHandle.

Referenced by PhotonConversionTrajectorySeedProducerFromQuadruplets::produce().

                                                           {

  myEsetup = &setup;
  myEvent = &event;

  if(seedCollection!=0)
    delete seedCollection;

  seedCollection= new TrajectorySeedCollection();

  size_t clustsOrZero = theClusterCheck.tooManyClusters(event);
  if (clustsOrZero){
    if (!theSilentOnClusterCheck)
      edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
    return ;
  }

  regions = theRegionProducer->regions(event,setup);

  event.getByLabel(_conf.getParameter<edm::InputTag>("primaryVerticesTag"), vertexHandle);
  if (!vertexHandle.isValid()){ 
    edm::LogError("PhotonConversionFinderFromTracks") << "Error! Can't get the product primary Vertex Collection "<< _conf.getParameter<edm::InputTag>("primaryVerticesTag") <<  "\n";
    return;
  }

  //Do the analysis
  loop();

 
#ifdef debugTSPFSLA 
  std::stringstream ss;
  ss.str("");
  ss << "\n++++++++++++++++++\n";
  ss << "seed collection size " << seedCollection->size();
  BOOST_FOREACH(TrajectorySeed tjS,*seedCollection){
    po.print(ss, tjS);
  }
  edm::LogInfo("debugTrajSeedFromQuadruplets") << ss.str();
  //-------------------------------------------------
#endif
}
void PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::clear ( void  )
TrajectorySeedCollection* PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::getTrajectorySeedCollection ( ) [inline]
void PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::init ( void  )
bool PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::inspect ( const TrackingRegion region) [private]

Definition at line 123 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

References exception, myEsetup, myEvent, CombinedHitQuadrupletGeneratorForPhotonConversion::run(), seedCollection, OrderedSeedingHits::size(), ss, theHitsGenerator, theSeedCreator, SeedForPhotonConversionFromQuadruplets::trajectorySeed(), and cms::Exception::what().

Referenced by loop().

                                       {

  const OrderedSeedingHits & hitss = theHitsGenerator->run(region, *myEvent, *myEsetup);
  
  unsigned int nHitss =  hitss.size();

#ifdef debugTSPFSLA 
  ss << "\n nHitss " << nHitss << "\n";
#endif

  if (seedCollection->empty()) seedCollection->reserve(nHitss/2); // don't do multiple reserves in the case of multiple regions: it would make things even worse
                                                               // as it will cause N re-allocations instead of the normal log(N)/log(2)

  unsigned int iHits=0, jHits=1;

  //
  // Trivial arbitration
  //
  // Vector to store old quad values
  std::vector<Quad> quadVector;

  for (; iHits < nHitss && jHits < nHitss; iHits+=2 , jHits+=2) { 

#ifdef debugTSPFSLA 
    //    ss << "\n iHits " << iHits << " " << jHits << "\n";
#endif
    //phits is the pair of hits for the positron
    const SeedingHitSet & phits =  hitss[iHits];
    //mhits is the pair of hits for the electron
    const SeedingHitSet & mhits =  hitss[jHits];

    //if (!theComparitor || theComparitor->compatible( hits, es) ) {

    try{
      //FIXME (modify the interface of the seed generator if needed)
      //passing the region, that is centered around the primary vertex
      theSeedCreator->trajectorySeed(*seedCollection, phits, mhits, region, *myEsetup, ss, quadVector);
    }catch(cms::Exception& er){
      edm::LogError("SeedingConversion") << " Problem in the Quad Seed creator " <<er.what()<<std::endl;
    }catch(std::exception& er){
      edm::LogError("SeedingConversion") << " Problem in the Quad Seed creator " <<er.what()<<std::endl;
    }
  }
  quadVector.clear();
  return true;
}
void PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::loop ( ) [private]

Definition at line 88 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.cc.

References inspect(), reco::Vertex::position(), primaryVertex, PtMinSelector_cfg::ptMin, ss, funct::true, vertexHandle, reco::Vertex::xError(), and reco::Vertex::zError().

Referenced by analyze().

      {

  
  ss.str("");
  
  float ptMin=0.1;
  
  BOOST_FOREACH(const reco::Vertex primaryVertex, *vertexHandle){

    //FIXME currnetly using the first primaryVertex, should loop on the promaryVertexes
    GlobalTrackingRegion region(ptMin
                                ,GlobalPoint(
                                             primaryVertex.position().x(),
                                             primaryVertex.position().y(), 
                                             primaryVertex.position().z() 
                                             )
                                ,primaryVertex.xError()*10
                                ,primaryVertex.zError()*10
                                ,true
                                ); 
    
#ifdef debugTSPFSLA 
    ss << "[PrintRegion] " << region.print() << std::endl;
#endif
    
    inspect(region);

  }
#ifdef debugTSPFSLA 
  edm::LogInfo("debugTrajSeedFromQuadruplets") << ss.str();
#endif
}

Member Data Documentation

Definition at line 47 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

Definition at line 54 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by init().

Definition at line 54 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by init().

Definition at line 67 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and inspect().

Definition at line 68 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and inspect().

Definition at line 70 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

Definition at line 65 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by loop().

Definition at line 54 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by init().

Definition at line 61 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

Definition at line 56 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

Definition at line 57 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze().

Definition at line 63 of file PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h.

Referenced by analyze(), and loop().