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 = other.theTracker;
18  theStripData = other.theStripData;
19  thePixelData = other.thePixelData;
20  thePhase2OTData = other.thePhase2OTData;
21  thePhase2OTVectorHits = other.thePhase2OTVectorHits;
22  thePhase2OTVectorHitsRej = other.thePhase2OTVectorHitsRej;
23  theOwner = other.theOwner;
24  other.theOwner = false; // make sure to fully transfer the ownership
25  theStripClustersToSkip = std::move(other.theStripClustersToSkip);
26  thePixelClustersToSkip = std::move(other.thePixelClustersToSkip);
27 }
29  theTracker = other.theTracker;
30  theStripData = other.theStripData;
31  thePixelData = other.thePixelData;
32  thePhase2OTData = other.thePhase2OTData;
33  thePhase2OTVectorHits = other.thePhase2OTVectorHits;
34  thePhase2OTVectorHitsRej = other.thePhase2OTVectorHitsRej;
35  theOwner = other.theOwner;
36  other.theOwner = false; // make sure to fully transfer the ownership
37  theStripClustersToSkip = std::move(other.theStripClustersToSkip);
38  thePixelClustersToSkip = std::move(other.thePixelClustersToSkip);
39  return *this;
40 }
41 
43  const MeasurementTrackerEvent &trackerEvent,
44  const edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > &stripClustersToSkip,
45  const edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > &pixelClustersToSkip)
46  : theTracker(trackerEvent.theTracker),
47  theStripData(trackerEvent.theStripData),
48  thePixelData(trackerEvent.thePixelData),
49  thePhase2OTData(nullptr),
50  thePhase2OTVectorHits(nullptr),
51  thePhase2OTVectorHitsRej(nullptr),
52  theOwner(false) {
53  //std::cout << "Creatign non-owned MT @ " << this << " from @ " << & trackerEvent << " (strip data @ " << trackerEvent.theStripData << ")" << std::endl;
54  if (stripClustersToSkip.refProd().id() != theStripData->handle().id()) {
55  edm::LogError("ProductIdMismatch") << "The strip masking does not point to the strip collection of clusters: "
56  << stripClustersToSkip.refProd().id() << "!=" << theStripData->handle().id();
57  throw cms::Exception("Configuration")
58  << "The strip masking does not point to the strip collection of clusters: "
59  << stripClustersToSkip.refProd().id() << "!=" << theStripData->handle().id() << "\n";
60  }
61 
62  if (pixelClustersToSkip.refProd().id() != thePixelData->handle().id()) {
63  edm::LogError("ProductIdMismatch") << "The pixel masking does not point to the proper collection of clusters: "
64  << pixelClustersToSkip.refProd().id() << "!=" << thePixelData->handle().id();
65  throw cms::Exception("Configuration")
66  << "The pixel masking does not point to the proper collection of clusters: "
67  << pixelClustersToSkip.refProd().id() << "!=" << thePixelData->handle().id() << "\n";
68  }
69 
72 
75 }
76 
77 //FIXME:just temporary solution for phase2!
79  const MeasurementTrackerEvent &trackerEvent,
80  const edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > &pixelClustersToSkip,
82  : theTracker(trackerEvent.theTracker),
83  theStripData(nullptr),
84  thePixelData(trackerEvent.thePixelData),
85  thePhase2OTData(trackerEvent.thePhase2OTData),
86  thePhase2OTVectorHits(trackerEvent.thePhase2OTVectorHits),
87  thePhase2OTVectorHitsRej(trackerEvent.thePhase2OTVectorHitsRej),
88  theOwner(false) {
89  if (pixelClustersToSkip.refProd().id() != thePixelData->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 
97  if (phase2OTClustersToSkip.refProd().id() != thePhase2OTData->handle().id()) {
98  edm::LogError("ProductIdMismatch") << "The pixel masking does not point to the proper collection of clusters: "
99  << pixelClustersToSkip.refProd().id() << "!=" << thePixelData->handle().id();
100  throw cms::Exception("Configuration")
101  << "The pixel masking does not point to the proper collection of clusters: "
102  << pixelClustersToSkip.refProd().id() << "!=" << thePixelData->handle().id() << "\n";
103  }
104 
107 
110 }
MeasurementTrackerEvent::theTracker
const MeasurementTracker * theTracker
Definition: MeasurementTrackerEvent.h:79
MeasurementTrackerEvent.h
MeasurementTrackerEvent::thePixelClustersToSkip
std::vector< bool > thePixelClustersToSkip
Definition: MeasurementTrackerEvent.h:88
MeasurementTrackerEvent::thePhase2OTClustersToSkip
std::vector< bool > thePhase2OTClustersToSkip
Definition: MeasurementTrackerEvent.h:89
funct::false
false
Definition: Factorize.h:29
TkMeasurementDetSet.h
edm::ContainerMask
Definition: ContainerMask.h:36
MeasurementTrackerEvent::thePhase2OTVectorHits
const VectorHitCollection * thePhase2OTVectorHits
Definition: MeasurementTrackerEvent.h:83
MeasurementTrackerEvent::operator=
MeasurementTrackerEvent & operator=(const MeasurementTrackerEvent &other)=delete
MeasurementTrackerEvent::stripClustersToSkip
const std::vector< bool > & stripClustersToSkip() const
Definition: MeasurementTrackerEvent.h:67
MeasurementTrackerEvent::theStripClustersToSkip
std::vector< bool > theStripClustersToSkip
Definition: MeasurementTrackerEvent.h:87
MeasurementTrackerEvent::thePhase2OTVectorHitsRej
const VectorHitCollection * thePhase2OTVectorHitsRej
Definition: MeasurementTrackerEvent.h:84
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:1464
MeasurementTrackerEvent::MeasurementTrackerEvent
MeasurementTrackerEvent()
Dummy constructor used for I/O (even if it's a transient object)
Definition: MeasurementTrackerEvent.h:21
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:16
MeasurementTrackerEvent::phase2OTClustersToSkip
const std::vector< bool > & phase2OTClustersToSkip() const
Definition: MeasurementTrackerEvent.h:69
MeasurementTrackerEvent::~MeasurementTrackerEvent
~MeasurementTrackerEvent()
Definition: MeasurementTrackerEvent.cc:4
MeasurementTrackerEvent::theStripData
const StMeasurementDetSet * theStripData
Definition: MeasurementTrackerEvent.h:80
MeasurementTrackerEvent::thePixelData
const PxMeasurementDetSet * thePixelData
Definition: MeasurementTrackerEvent.h:81
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
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:245
MeasurementTrackerEvent::pixelClustersToSkip
const std::vector< bool > & pixelClustersToSkip() const
Definition: MeasurementTrackerEvent.h:68
edm::HandleBase::id
ProductID id() const
Definition: HandleBase.cc:29
MeasurementTrackerEvent::thePhase2OTData
const Phase2OTMeasurementDetSet * thePhase2OTData
Definition: MeasurementTrackerEvent.h:82
MeasurementTrackerEvent::theOwner
bool theOwner
Definition: MeasurementTrackerEvent.h:85