00001 #ifndef DIGIECAL_ECALDIGICOLLECTION_H 00002 #define DIGIECAL_ECALDIGICOLLECTION_H 00003 00004 #include "DataFormats/EcalDigi/interface/EBDataFrame.h" 00005 #include "DataFormats/EcalDigi/interface/EEDataFrame.h" 00006 #include "DataFormats/EcalDigi/interface/ESDataFrame.h" 00007 #include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveDigi.h" 00008 #include "DataFormats/EcalDigi/interface/EcalPseudoStripInputDigi.h" 00009 #include "DataFormats/EcalDigi/interface/EBSrFlag.h" 00010 #include "DataFormats/EcalDigi/interface/EESrFlag.h" 00011 #include "DataFormats/EcalDigi/interface/EcalPnDiodeDigi.h" 00012 #include "DataFormats/EcalDigi/interface/EcalMatacqDigi.h" 00013 #include "DataFormats/Common/interface/SortedCollection.h" 00014 00015 #include "DataFormats/DetId/interface/DetId.h" 00016 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h" 00017 #include "DataFormats/Common/interface/DataFrameContainer.h" 00018 00019 class EcalDigiCollection : public edm::DataFrameContainer { 00020 public: 00021 typedef edm::DataFrameContainer::size_type size_type; 00022 static const size_type MAXSAMPLES = 10; 00023 explicit EcalDigiCollection(size_type istride=MAXSAMPLES, int isubdet=0) : 00024 edm::DataFrameContainer(istride, isubdet){} 00025 void swap(DataFrameContainer& other) {this->DataFrameContainer::swap(other);} 00026 }; 00027 00028 // make edm (and ecal client) happy 00029 class EBDigiCollection : public EcalDigiCollection { 00030 public: 00031 typedef edm::DataFrameContainer::size_type size_type; 00032 typedef EBDataFrame Digi; 00033 typedef Digi::key_type DetId; 00034 00035 EBDigiCollection(size_type istride=MAXSAMPLES) : 00036 EcalDigiCollection(istride, EcalBarrel){} 00037 void swap(EBDigiCollection& other) {this->EcalDigiCollection::swap(other);} 00038 }; 00039 00040 class EEDigiCollection : public EcalDigiCollection { 00041 public: 00042 typedef edm::DataFrameContainer::size_type size_type; 00043 typedef EEDataFrame Digi; 00044 typedef Digi::key_type DetId; 00045 00046 EEDigiCollection(size_type istride=MAXSAMPLES) : 00047 EcalDigiCollection(istride, EcalEndcap){} 00048 void swap(EEDigiCollection& other) {this->EcalDigiCollection::swap(other);} 00049 }; 00050 00051 // Free swap functions 00052 inline 00053 void swap(EcalDigiCollection& lhs, EcalDigiCollection& rhs) { 00054 lhs.swap(rhs); 00055 } 00056 00057 inline 00058 void swap(EBDigiCollection& lhs, EBDigiCollection& rhs) { 00059 lhs.swap(rhs); 00060 } 00061 00062 inline 00063 void swap(EEDigiCollection& lhs, EEDigiCollection& rhs) { 00064 lhs.swap(rhs); 00065 } 00066 00067 //typedef EcalDigiCollection EBDigiCollection; 00068 //typedef EcalDigiCollection EEDigiCollection; 00069 00070 typedef edm::SortedCollection<ESDataFrame> ESDigiCollection; 00071 typedef edm::SortedCollection<EcalTriggerPrimitiveDigi> EcalTrigPrimDigiCollection; 00072 typedef edm::SortedCollection<EcalPseudoStripInputDigi> EcalPSInputDigiCollection; 00073 typedef edm::SortedCollection<EBSrFlag> EBSrFlagCollection; 00074 typedef edm::SortedCollection<EESrFlag> EESrFlagCollection; 00075 typedef edm::SortedCollection<EcalPnDiodeDigi> EcalPnDiodeDigiCollection; 00076 typedef edm::SortedCollection<EcalMatacqDigi> EcalMatacqDigiCollection; 00077 00078 #endif