Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-24 02:13:02

0001 #include "DataFormats/Common/interface/Handle.h"
0002 #include "FWCore/Framework/interface/global/EDAnalyzer.h"
0003 #include "FWCore/Framework/interface/Event.h"
0004 #include "FWCore/Framework/interface/EventSetup.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0007 #include "TrackingTools/TransientTrackingRecHit/interface/SeedingLayerSetsHits.h"
0008 
0009 #include <string>
0010 #include <iostream>
0011 
0012 struct TestSeedingLayers final : public edm::global::EDAnalyzer<> {
0013   explicit TestSeedingLayers(const edm::ParameterSet& conf)
0014       : SeedingLayerSetsHits_token(consumes<SeedingLayerSetsHits>(edm::InputTag("MixedLayerTriplets"))) {}
0015   virtual ~TestSeedingLayers() = default;
0016 
0017   void analyze(edm::StreamID, edm::Event const& iEvent, edm::EventSetup const&) const {
0018     edm::Handle<SeedingLayerSetsHits> layersH = iEvent.getHandle(SeedingLayerSetsHits_token);
0019     auto const& layers = *layersH;
0020 
0021     edm::LogPrint("TestSeedingLayers") << layers.numberOfLayersInSet() << ' ' << layers.size();
0022 
0023     for (auto const& lset : layers) {
0024       edm::LogPrint("TestSeedingLayers") << lset.size();
0025       for (auto const& la : lset) {
0026         edm::LogPrint("TestSeedingLayers") << ": " << la.name() << ' ' << la.index() << ' ' << la.hits().size();
0027       }
0028       edm::LogPrint("TestSeedingLayers");
0029     }
0030   }
0031 
0032 private:
0033   edm::EDGetTokenT<SeedingLayerSetsHits> SeedingLayerSetsHits_token;
0034 };
0035 
0036 #include "FWCore/Framework/interface/MakerMacros.h"
0037 DEFINE_FWK_MODULE(TestSeedingLayers);