CMS 3D CMS Logo

RPCSeedGenerator Class Reference

#include <RecoMuon/MuonSeedGenerator/src/RPCSeedGenerator.h>

Inheritance diagram for RPCSeedGenerator:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &)
 RPCSeedGenerator (const edm::ParameterSet &)
virtual ~RPCSeedGenerator ()

Private Member Functions

void checkAndFill (RPCSeedFinder &Theseed, const edm::EventSetup &eSetup)
void complete (RPCSeedFinder &seed, MuonTransientTrackingRecHit::MuonRecHitContainer &recHits, bool *used=0) const

Private Attributes

edm::InputTag theRPCRecHits
std::vector< TrajectorySeedtheSeeds


Detailed Description

Definition at line 32 of file RPCSeedGenerator.h.


Constructor & Destructor Documentation

RPCSeedGenerator::RPCSeedGenerator ( const edm::ParameterSet pset  ) 

Definition at line 60 of file RPCSeedGenerator.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), edm::ParameterSet::getParameter(), and theRPCRecHits.

00060                                                              {
00061   produces<TrajectorySeedCollection>(); 
00062 
00063   theRPCRecHits = pset.getParameter<edm::InputTag>("RPCRecHitsLabel");
00064   cout << endl << "[RPCSeedGenerator] --> Constructor called" << endl;
00065 }  

RPCSeedGenerator::~RPCSeedGenerator (  )  [virtual]

Definition at line 69 of file RPCSeedGenerator.cc.

References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().

00069                                    {
00070   cout << "[RPCSeedGenerator] --> Destructor called" << endl;
00071 }


Member Function Documentation

void RPCSeedGenerator::checkAndFill ( RPCSeedFinder Theseed,
const edm::EventSetup eSetup 
) [private]

Definition at line 278 of file RPCSeedGenerator.cc.

References RPCSeedFinder::nrhit(), RPCSeedFinder::seeds(), and theSeeds.

Referenced by produce().

00278                                                                                       {
00279   
00280   if (theSeed.nrhit()>1 ) {
00281     vector<TrajectorySeed> the_seeds =  theSeed.seeds(eSetup);
00282     for (vector<TrajectorySeed>::const_iterator
00283            the_seed=the_seeds.begin(); the_seed!=the_seeds.end(); ++the_seed) {
00284       theSeeds.push_back(*the_seed);
00285     }
00286   }
00287 }

void RPCSeedGenerator::complete ( RPCSeedFinder seed,
MuonTransientTrackingRecHit::MuonRecHitContainer recHits,
bool used = 0 
) const [private]

Referenced by produce().

void RPCSeedGenerator::produce ( edm::Event event,
const edm::EventSetup eSetup 
) [virtual]

Implements edm::EDProducer.

Definition at line 74 of file RPCSeedGenerator.cc.

References RPCSeedFinder::add(), checkAndFill(), complete(), counter(), GenMuonPlsPt100GeV_cfg::cout, lat::endl(), RPCSeedFinder::firstRecHit(), edm::EventSetup::get(), i, iter, RPCSeedFinder::nrhit(), output(), MuonDetLayerMeasurements::recHits(), theRPCRecHits, and theSeeds.

00074                                                                           {
00075   
00076   theSeeds.clear();
00077 
00078   // create the pointer to the Seed container
00079   auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection());
00080   
00081   // Muon Geometry - DT, CSC and RPC 
00082   edm::ESHandle<MuonDetLayerGeometry> muonLayers;
00083   eSetup.get<MuonRecoGeometryRecord>().get(muonLayers);
00084 
00085   // get the RPC layers
00086   vector<DetLayer*> RPCBarrelLayers = muonLayers->barrelRPCLayers();
00087   const DetLayer* RB4L  = RPCBarrelLayers[5];
00088   const DetLayer* RB3L  = RPCBarrelLayers[4];
00089   const DetLayer* RB22L = RPCBarrelLayers[3];
00090   const DetLayer* RB21L = RPCBarrelLayers[2];
00091   const DetLayer* RB12L = RPCBarrelLayers[1];
00092   const DetLayer* RB11L = RPCBarrelLayers[0];
00093 
00094 
00095   MuonDetLayerMeasurements muonMeasurements(edm::InputTag(),edm::InputTag(), theRPCRecHits,
00096                                             false, false, true);
00097 
00098   
00099   MuonRecHitContainer list11 = muonMeasurements.recHits(RB11L,event);
00100   MuonRecHitContainer list12 = muonMeasurements.recHits(RB12L,event);
00101   MuonRecHitContainer list21 = muonMeasurements.recHits(RB21L,event);
00102   MuonRecHitContainer list22 = muonMeasurements.recHits(RB22L,event);
00103   MuonRecHitContainer list3  = muonMeasurements.recHits(RB3L,event);
00104   MuonRecHitContainer list4  = muonMeasurements.recHits(RB4L,event); 
00105 
00106 
00107   if (list11.size() == 1 && list21.size() == 1 && list3.size() == 1 && list4.size() == 1) {
00108 
00109   
00110   cout << "list11 = " << list11.size() << endl;
00111   cout << "list21 = " << list21.size() << endl;
00112   cout << "list3 = " << list3.size() << endl;
00113   cout << "list4 = " << list4.size() << endl;
00114   
00115 
00116     unsigned int counter;
00117     
00118      bool* RB11 = 0;
00119        if (list11.size()) {
00120          RB11 = new bool[list11.size()];
00121          for ( size_t i=0; i<list11.size(); i++ ) RB11[i]=false;
00122        }
00123 
00124      bool* RB21 = 0;
00125        if (list21.size()) {
00126          RB21 = new bool[list21.size()];
00127          for ( size_t i=0; i<list21.size(); i++ ) RB21[i]=false;
00128        }
00129 
00130 
00131      bool* RB3 = 0;
00132        if (list3.size()) {
00133          RB3 = new bool[list3.size()];
00134          for ( size_t i=0; i<list3.size(); i++ ) RB3[i]=false;
00135        }
00136 
00137 
00138       for (MuonRecHitContainer::iterator iter=list4.begin(); iter!=list4.end(); iter++ ){
00139         RPCSeedFinder theSeed;
00140         theSeed.add(*iter);
00141         complete(theSeed, list3, RB3);
00142         complete(theSeed, list21, RB21);
00143         complete(theSeed, list11, RB11);
00144         checkAndFill(theSeed, eSetup);
00145       }
00146   
00147       for ( counter = 0; counter<list3.size(); counter++ ){
00148         if ( !RB3[counter] ) { 
00149           RPCSeedFinder theSeed;
00150           theSeed.add(list3[counter]);
00151           complete(theSeed, list21, RB21);
00152           complete(theSeed, list11, RB11);
00153           complete(theSeed, list4);
00154           checkAndFill(theSeed,eSetup);
00155         }
00156       }
00157   
00158       for ( counter = 0; counter<list21.size(); counter++ ){
00159         if ( !RB21[counter] ) { 
00160           RPCSeedFinder theSeed;
00161           theSeed.add(list21[counter]);
00162           complete(theSeed, list11, RB11);
00163           complete(theSeed, list4);
00164           complete(theSeed, list3, RB3);
00165             if (theSeed.nrhit()>1 || (theSeed.nrhit()==1 &&
00166                                       theSeed.firstRecHit()->dimension()==4) ) {
00167               checkAndFill(theSeed,eSetup);
00168              }
00169           }
00170         }
00171  
00172       for ( counter = 0; counter<list11.size(); counter++ ){
00173         if ( !RB11[counter] ) { 
00174           RPCSeedFinder theSeed;
00175           theSeed.add(list11[counter]);
00176           complete(theSeed, list4);
00177           complete(theSeed, list3, RB3);
00178           complete(theSeed, list21, RB21);
00179             if (theSeed.nrhit()>1 || (theSeed.nrhit()==1 &&
00180                                       theSeed.firstRecHit()->dimension()==4) ) {
00181               checkAndFill(theSeed,eSetup);
00182             }
00183           }
00184         }
00185   
00186     if ( RB3 ) delete [] RB3;
00187     if ( RB21 ) delete [] RB21;
00188     if ( RB11 ) delete [] RB11;
00189 
00190     if(theSeeds.size() == 1) output->push_back(theSeeds.front());
00191   
00192     else{
00193       for(vector<TrajectorySeed>::iterator seed = theSeeds.begin();
00194           seed != theSeeds.end(); ++seed){
00195         int counter =0;
00196         for(vector<TrajectorySeed>::iterator seed2 = seed;
00197             seed2 != theSeeds.end(); ++seed2) 
00198           if( seed->startingState().parameters().vector() ==
00199               seed2->startingState().parameters().vector() )
00200             ++counter;
00201       
00202         if( counter > 1 ) theSeeds.erase(seed--);
00203         else output->push_back(*seed);
00204       }
00205     }
00206     
00207     event.put(output);
00208     
00209   }
00210 
00211 }


Member Data Documentation

edm::InputTag RPCSeedGenerator::theRPCRecHits [private]

Definition at line 51 of file RPCSeedGenerator.h.

Referenced by produce(), and RPCSeedGenerator().

std::vector<TrajectorySeed> RPCSeedGenerator::theSeeds [private]

Definition at line 49 of file RPCSeedGenerator.h.

Referenced by checkAndFill(), and produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:31:07 2009 for CMSSW by  doxygen 1.5.4