Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:56

0001 #include "L1Trigger/L1TMuonEndCap/interface/EndCapParamsHelper.h"
0002 
0003 #include <iostream>
0004 
0005 using namespace l1t;
0006 using namespace std;
0007 
0008 const EndCapParamsHelper* EndCapParamsHelper::readFromEventSetup(const L1TMuonEndCapParams* es) {
0009   return new EndCapParamsHelper(es);
0010 }
0011 
0012 EndCapParamsHelper* EndCapParamsHelper::readAndWriteFromEventSetup(const L1TMuonEndCapParams* es) {
0013   EndCapParamsHelper* x = new EndCapParamsHelper(es);
0014   x->useCopy();
0015   return x;
0016 }
0017 
0018 EndCapParamsHelper::EndCapParamsHelper(L1TMuonEndCapParams* w) {
0019   write_ = w;
0020   check_write();
0021   we_own_write_ = false;
0022   //write_->m_version = VERSION;
0023   read_ = write_;
0024 }
0025 
0026 EndCapParamsHelper::EndCapParamsHelper(const L1TMuonEndCapParams* es) {
0027   read_ = es;
0028   write_ = nullptr;
0029 }
0030 
0031 void EndCapParamsHelper::useCopy() {
0032   write_ = new L1TMuonEndCapParams(*read_);
0033   we_own_write_ = true;
0034   read_ = write_;
0035 }
0036 
0037 EndCapParamsHelper::~EndCapParamsHelper() {
0038   if (we_own_write_ && write_)
0039     delete write_;
0040 }
0041 
0042 // print all the L1 GT stable parameters
0043 void EndCapParamsHelper::print(std::ostream& myStr) const { myStr << "\nL1T EndCap  Parameters \n" << std::endl; }