Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-15 04:15:22

0001 #include "RPCEventDump.h"
0002 #include "Geometry/RPCGeometry/interface/RPCRoll.h"
0003 #include "Geometry/RPCGeometry/interface/RPCRollSpecs.h"
0004 
0005 #include "DataFormats/RPCDigi/interface/RPCDigiCollection.h"
0006 #include "DataFormats/Common/interface/Handle.h"
0007 #include "FWCore/Framework/interface/Event.h"
0008 #include "FWCore/Framework/interface/EventSetup.h"
0009 
0010 #include <iostream>
0011 
0012 RPCEventDump::RPCEventDump(const edm::ParameterSet& config) {
0013   std::cout << "Initialize the Event Dump" << std::endl;
0014   produces<RPCDigiCollection>();
0015 
0016   filesed = config.getParameter<std::vector<std::string> >("EventDumps");
0017   rpcdigiprint = config.getParameter<bool>("printOut");
0018   std::cout << "Number of Input files =" << filesed.size() << std::endl;
0019   if (rpcdigiprint) {
0020     std::cout << "Event Dump Digi Creation" << std::endl;
0021     std::cout << "Number of Input files =" << filesed.size() << std::endl;
0022     for (std::vector<std::string>::iterator i = filesed.begin(); i < filesed.end(); i++) {
0023       std::cout << "input file " << *i << std::endl;
0024     }
0025   }
0026 }
0027 
0028 void RPCEventDump::produce(edm::Event& e, const edm::EventSetup& c) {
0029   if (rpcdigiprint) {
0030     std::cout << " Evento Done : "
0031               << "   -- run=" << e.id().run() << " event=" << e.id().event() << std::endl;
0032   }
0033   if (e.id().event() <= filesed.size()) {
0034     if (rpcdigiprint) {
0035       std::cout << "Opening file " << filesed[e.id().event() - 1] << std::endl;
0036     }
0037   }
0038   std::unique_ptr<RPCDigiCollection> pDigis(new RPCDigiCollection());
0039 
0040   {
0041     RPCDetId r(0, 1, 1, 10, 1, 1, 1);
0042     RPCDigi rpcDigi(1, 0);
0043     pDigis->insertDigi(r, rpcDigi);
0044   }
0045   {
0046     RPCDetId r(0, 1, 1, 10, 2, 1, 1);
0047     RPCDigi rpcDigi1(1, 0);
0048     pDigis->insertDigi(r, rpcDigi1);
0049     RPCDigi rpcDigi2(2, 0);
0050     pDigis->insertDigi(r, rpcDigi2);
0051   }
0052   {
0053     RPCDetId r(0, 1, 2, 10, 1, 1, 1);
0054     RPCDigi rpcDigi1(1, 0);
0055     pDigis->insertDigi(r, rpcDigi1);
0056     RPCDigi rpcDigi2(2, 0);
0057     pDigis->insertDigi(r, rpcDigi2);
0058     RPCDigi rpcDigi3(3, 0);
0059     pDigis->insertDigi(r, rpcDigi3);
0060   }
0061   {
0062     RPCDetId r(0, 1, 2, 10, 2, 1, 1);
0063     RPCDigi rpcDigi1(1, 0);
0064     pDigis->insertDigi(r, rpcDigi1);
0065     RPCDigi rpcDigi2(2, 0);
0066     pDigis->insertDigi(r, rpcDigi2);
0067     RPCDigi rpcDigi3(3, 0);
0068     pDigis->insertDigi(r, rpcDigi3);
0069     RPCDigi rpcDigi4(4, 0);
0070     pDigis->insertDigi(r, rpcDigi4);
0071   }
0072   {
0073     RPCDetId r(0, 1, 3, 10, 1, 1, 1);
0074     RPCDigi rpcDigi1(1, 0);
0075     pDigis->insertDigi(r, rpcDigi1);
0076     RPCDigi rpcDigi2(2, 0);
0077     pDigis->insertDigi(r, rpcDigi2);
0078     RPCDigi rpcDigi3(3, 0);
0079     pDigis->insertDigi(r, rpcDigi3);
0080     RPCDigi rpcDigi4(4, 0);
0081     pDigis->insertDigi(r, rpcDigi4);
0082     RPCDigi rpcDigi5(5, 0);
0083     pDigis->insertDigi(r, rpcDigi5);
0084   }
0085   {
0086     RPCDetId r(0, 1, 4, 10, 1, 1, 1);
0087     RPCDigi rpcDigi4(4, 0);
0088     pDigis->insertDigi(r, rpcDigi4);
0089     RPCDigi rpcDigi5(5, 0);
0090     pDigis->insertDigi(r, rpcDigi5);
0091     RPCDigi rpcDigi6(6, 0);
0092     pDigis->insertDigi(r, rpcDigi6);
0093   }
0094   e.put(std::move(pDigis));
0095 }
0096 
0097 DEFINE_FWK_MODULE(RPCEventDump);