Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:32

0001 //-------------------------------------------------
0002 //
0003 /**  \class DTTFFEDReader
0004  *
0005  *   L1 DT Track Finder Raw-to-Digi
0006  *
0007  *
0008  *
0009  *   J. Troconiz  UAM Madrid
0010  *   E. Delmeire  UAM Madrid
0011  */
0012 //
0013 //--------------------------------------------------
0014 #ifndef DTTFRawToDigi_DTTFFEDReader_h
0015 #define DTTFRawToDigi_DTTFFEDReader_h
0016 
0017 #include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h"
0018 #include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h"
0019 #include "DataFormats/L1DTTrackFinder/interface/L1MuDTTrackContainer.h"
0020 #include "FWCore/Framework/interface/ConsumesCollector.h"
0021 
0022 #include "FWCore/Framework/interface/stream/EDProducer.h"
0023 #include <DataFormats/FEDRawData/interface/FEDRawData.h>
0024 #include <DataFormats/FEDRawData/interface/FEDRawDataCollection.h>
0025 
0026 #include <FWCore/ParameterSet/interface/ParameterSet.h>
0027 #include <FWCore/Utilities/interface/InputTag.h>
0028 
0029 #include <string>
0030 
0031 class DTTFFEDReader : public edm::stream::EDProducer<> {
0032 public:
0033   /// Constructor
0034   DTTFFEDReader(const edm::ParameterSet &pset);
0035 
0036   /// Destructor
0037   ~DTTFFEDReader() override;
0038 
0039   /// Produce digis out of raw data
0040   void produce(edm::Event &e, const edm::EventSetup &c) override;
0041 
0042   /// Generate and fill FED raw data for a full event
0043   bool fillRawData(edm::Event &e,
0044                    L1MuDTChambPhContainer::Phi_Container &phi_data,
0045                    L1MuDTChambThContainer::The_Container &the_data,
0046                    L1MuDTTrackContainer::TrackContainer &tra_data);
0047 
0048 private:
0049   edm::InputTag DTTFInputTag;
0050 
0051   bool verbose_;
0052 
0053   // Operations
0054 
0055   // access data
0056   const L1MuDTChambPhContainer::Phi_Container &p_data();
0057 
0058   const L1MuDTChambThContainer::The_Container &t_data();
0059 
0060   const L1MuDTTrackContainer::TrackContainer &k_data();
0061 
0062   // Process one event
0063   void analyse(edm::Event &e);
0064 
0065   // clear data container
0066   void clear();
0067 
0068   // process data
0069   void process(edm::Event &e);
0070 
0071   // Match PHTF - ETTF tracks
0072   void match();
0073 
0074   // data containers
0075   L1MuDTChambPhContainer::Phi_Container phiSegments;
0076 
0077   L1MuDTChambThContainer::The_Container theSegments;
0078 
0079   L1MuDTTrackContainer::TrackContainer dtTracks;
0080 
0081   unsigned int etTrack[3][12][6][2];
0082 
0083   unsigned int efTrack[3][12][6][2];
0084 
0085   // utilities
0086   int channel(int wheel, int sector, int bx);
0087 
0088   int bxNr(int channel);
0089 
0090   int sector(int channel);
0091 
0092   int wheel(int channel);
0093 
0094   edm::InputTag getDTTFInputTag() { return DTTFInputTag; }
0095 
0096   edm::EDGetTokenT<FEDRawDataCollection> Raw_token;
0097 };
0098 #endif