CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
const std::vector< bool > & phase2OTClustersToSkip() const
const VectorHitCollection * thePhase2OTVectorHits
ProductID id() const
Definition: HandleBase.cc:29
const VectorHitCollection * thePhase2OTVectorHitsRej
std::vector< bool > thePhase2OTClustersToSkip
MeasurementTrackerEvent()
Dummy constructor used for I/O (even if it&#39;s a transient object)
const edm::Handle< edmNew::DetSetVector< SiPixelCluster > > & handle() const
Log< level::Error, false > LogError
const std::vector< bool > & pixelClustersToSkip() const
const std::vector< bool > & stripClustersToSkip() const
const StMeasurementDetSet * theStripData
const PxMeasurementDetSet * thePixelData
const edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D > > & handle() const
std::vector< bool > theStripClustersToSkip
def move
Definition: eostools.py:511
MeasurementTrackerEvent & operator=(const MeasurementTrackerEvent &other)=delete
const Phase2OTMeasurementDetSet * thePhase2OTData
const MeasurementTracker * theTracker
std::vector< bool > thePixelClustersToSkip
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()