CMS 3D CMS Logo

MeasurementTrackerEvent.cc
Go to the documentation of this file.
3 
5  if (theOwner) {
6  //std::cout << "Deleting owned MT @" << this << " (strip data @ " << theStripData << ")" << std::endl;
7  delete theStripData;
8  theStripData = nullptr; // also sets to zero since sometimes the FWK seems
9  delete thePixelData;
10  thePixelData = nullptr; // to double-delete the same object (!!!)
11  delete thePhase2OTData;
12  thePhase2OTData = nullptr; // to double-delete the same object (!!!)
13  }
14 }
15 
17  theTracker = std::move(other.theTracker);
18  theStripData = std::move(other.theStripData);
19  thePixelData = std::move(other.thePixelData);
20  thePhase2OTData = std::move(other.thePhase2OTData);
21  theOwner = other.theOwner;
22  other.theOwner = false; // make sure to fully transfer the ownership
23  theStripClustersToSkip = std::move(other.theStripClustersToSkip);
24  thePixelClustersToSkip = std::move(other.thePixelClustersToSkip);
25 }
27  theTracker = std::move(other.theTracker);
28  theStripData = std::move(other.theStripData);
29  thePixelData = std::move(other.thePixelData);
30  thePhase2OTData = std::move(other.thePhase2OTData);
31  theOwner = other.theOwner;
32  other.theOwner = false; // make sure to fully transfer the ownership
33  theStripClustersToSkip = std::move(other.theStripClustersToSkip);
34  thePixelClustersToSkip = std::move(other.thePixelClustersToSkip);
35  return *this;
36 }
37 
39  const MeasurementTrackerEvent &trackerEvent,
40  const edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > &stripClustersToSkip,
41  const edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > &pixelClustersToSkip)
42  : theTracker(trackerEvent.theTracker),
43  theStripData(trackerEvent.theStripData),
44  thePixelData(trackerEvent.thePixelData),
45  thePhase2OTData(nullptr),
46  theOwner(false) {
47  //std::cout << "Creatign non-owned MT @ " << this << " from @ " << & trackerEvent << " (strip data @ " << trackerEvent.theStripData << ")" << std::endl;
48  if (stripClustersToSkip.refProd().id() != theStripData->handle().id()) {
49  edm::LogError("ProductIdMismatch") << "The strip masking does not point to the strip collection of clusters: "
50  << stripClustersToSkip.refProd().id() << "!=" << theStripData->handle().id();
51  throw cms::Exception("Configuration")
52  << "The strip masking does not point to the strip collection of clusters: "
53  << stripClustersToSkip.refProd().id() << "!=" << theStripData->handle().id() << "\n";
54  }
55 
56  if (pixelClustersToSkip.refProd().id() != thePixelData->handle().id()) {
57  edm::LogError("ProductIdMismatch") << "The pixel masking does not point to the proper collection of clusters: "
58  << pixelClustersToSkip.refProd().id() << "!=" << thePixelData->handle().id();
59  throw cms::Exception("Configuration")
60  << "The pixel masking does not point to the proper collection of clusters: "
61  << pixelClustersToSkip.refProd().id() << "!=" << thePixelData->handle().id() << "\n";
62  }
63 
66 
69 }
70 
71 //FIXME:just temporary solution for phase2!
73  const MeasurementTrackerEvent &trackerEvent,
74  const edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > &pixelClustersToSkip,
76  : theTracker(trackerEvent.theTracker),
77  theStripData(nullptr),
78  thePixelData(trackerEvent.thePixelData),
79  thePhase2OTData(trackerEvent.thePhase2OTData),
80  theOwner(false) {
81  if (pixelClustersToSkip.refProd().id() != thePixelData->handle().id()) {
82  edm::LogError("ProductIdMismatch") << "The pixel masking does not point to the proper collection of clusters: "
83  << pixelClustersToSkip.refProd().id() << "!=" << thePixelData->handle().id();
84  throw cms::Exception("Configuration")
85  << "The pixel masking does not point to the proper collection of clusters: "
86  << pixelClustersToSkip.refProd().id() << "!=" << thePixelData->handle().id() << "\n";
87  }
88 
89  if (phase2OTClustersToSkip.refProd().id() != thePhase2OTData->handle().id()) {
90  edm::LogError("ProductIdMismatch") << "The pixel masking does not point to the proper collection of clusters: "
91  << pixelClustersToSkip.refProd().id() << "!=" << thePixelData->handle().id();
92  throw cms::Exception("Configuration")
93  << "The pixel masking does not point to the proper collection of clusters: "
94  << pixelClustersToSkip.refProd().id() << "!=" << thePixelData->handle().id() << "\n";
95  }
96 
99 
102 }
MeasurementTrackerEvent::theTracker
const MeasurementTracker * theTracker
Definition: MeasurementTrackerEvent.h:72
MeasurementTrackerEvent.h
MeasurementTrackerEvent::thePixelClustersToSkip
std::vector< bool > thePixelClustersToSkip
Definition: MeasurementTrackerEvent.h:79
MeasurementTrackerEvent::thePhase2OTClustersToSkip
std::vector< bool > thePhase2OTClustersToSkip
Definition: MeasurementTrackerEvent.h:80
funct::false
false
Definition: Factorize.h:34
TkMeasurementDetSet.h
edm::ContainerMask
Definition: ContainerMask.h:36
MeasurementTrackerEvent::operator=
MeasurementTrackerEvent & operator=(const MeasurementTrackerEvent &other)=delete
MeasurementTrackerEvent::stripClustersToSkip
const std::vector< bool > & stripClustersToSkip() const
Definition: MeasurementTrackerEvent.h:60
MeasurementTrackerEvent::theStripClustersToSkip
std::vector< bool > theStripClustersToSkip
Definition: MeasurementTrackerEvent.h:78
PxMeasurementDetSet::handle
const edm::Handle< edmNew::DetSetVector< SiPixelCluster > > & handle() const
Definition: TkMeasurementDetSet.h:385
Phase2OTMeasurementDetSet::handle
const edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D > > & handle() const
Definition: TkMeasurementDetSet.h:471
trackingPlots.other
other
Definition: trackingPlots.py:1465
MeasurementTrackerEvent::MeasurementTrackerEvent
MeasurementTrackerEvent()
Dummy constructor used for I/O (even if it's a transient object)
Definition: MeasurementTrackerEvent.h:20
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:15
edm::LogError
Definition: MessageLogger.h:183
MeasurementTrackerEvent::phase2OTClustersToSkip
const std::vector< bool > & phase2OTClustersToSkip() const
Definition: MeasurementTrackerEvent.h:62
MeasurementTrackerEvent::~MeasurementTrackerEvent
~MeasurementTrackerEvent()
Definition: MeasurementTrackerEvent.cc:4
MeasurementTrackerEvent::theStripData
const StMeasurementDetSet * theStripData
Definition: MeasurementTrackerEvent.h:73
MeasurementTrackerEvent::thePixelData
const PxMeasurementDetSet * thePixelData
Definition: MeasurementTrackerEvent.h:74
edmNew::DetSetVector
Definition: DetSetNew.h:13
StMeasurementDetSet::handle
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
Definition: TkMeasurementDetSet.h:204
eostools.move
def move(src, dest)
Definition: eostools.py:511
Exception
Definition: hltDiff.cc:246
MeasurementTrackerEvent::pixelClustersToSkip
const std::vector< bool > & pixelClustersToSkip() const
Definition: MeasurementTrackerEvent.h:61
edm::HandleBase::id
ProductID id() const
Definition: HandleBase.cc:13
MeasurementTrackerEvent::thePhase2OTData
const Phase2OTMeasurementDetSet * thePhase2OTData
Definition: MeasurementTrackerEvent.h:75
MeasurementTrackerEvent::theOwner
bool theOwner
Definition: MeasurementTrackerEvent.h:76