The Gaudi Framework  master (37c0b60a)
SmartDataStorePtr.h File Reference
Include dependency graph for SmartDataStorePtr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SmartDataStorePtr< TYPE, LOADER >
 A small class used to access easily (and efficiently) data items residing in data stores. More...
 

Functions

template<class A , class LDA , class B , class LDB >
bool operator&& (SmartDataStorePtr< A, LDA > &object_1, SmartDataStorePtr< B, LDB > &object_2)
 Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); SmartDataPtr<MCParticleVector> mctracks (evt,"/MC/MCParticles"); if ( mctracks && mcvertices ) { ... More...
 
template<class B , class LDB >
bool operator&& (bool test, SmartDataStorePtr< B, LDB > &object)
 Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ... More...
 
template<class B , class LDB >
bool operator&& (SmartDataStorePtr< B, LDB > &object, bool test)
 Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ... More...
 
template<class A , class LDA , class B , class LDB >
bool operator|| (SmartDataStorePtr< A, LDA > &object_1, SmartDataStorePtr< B, LDB > &object_2)
 Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); SmartDataPtr<MCParticleVector> mctracks (evt,"/MC/MCParticles"); if ( mctracks || mcvertices ) { ... More...
 
template<class B , class LDB >
bool operator|| (bool test, SmartDataStorePtr< B, LDB > &object)
 Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ... More...
 
template<class B , class LDB >
bool operator|| (SmartDataStorePtr< B, LDB > &object, bool test)
 Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ... More...
 

Function Documentation

◆ operator&&() [1/3]

template<class B , class LDB >
bool operator&& ( bool  test,
SmartDataStorePtr< B, LDB > &  object 
)

Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ...

if ( test && mcvertices ) { ... } and tests the existence of BOTH objects in the data store.

Parameters
testFirst boolean to test
objectSmart pointer to second object
Returns
Boolean indicating existence of both objects

Definition at line 162 of file SmartDataStorePtr.h.

162  {
163  if ( test ) { // Test existence of the first object
164  if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
165  return true; // Fine: Both objects exist
166  }
167  }
168  return false; // Tough luck: One is missing.
169 }

◆ operator&&() [2/3]

template<class A , class LDA , class B , class LDB >
bool operator&& ( SmartDataStorePtr< A, LDA > &  object_1,
SmartDataStorePtr< B, LDB > &  object_2 
)

Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); SmartDataPtr<MCParticleVector> mctracks (evt,"/MC/MCParticles"); if ( mctracks && mcvertices ) { ...

} and tests the existence of BOTH objects in the data store.

Parameters
object_1Smart pointer to object 1
object_2Smart pointer to second object
Returns
Boolean indicating existence of both objects

Definition at line 142 of file SmartDataStorePtr.h.

142  {
143  if ( 0 != object_1.accessTypeSafeData() ) { // Test existence of the first object
144  if ( 0 != object_2.accessTypeSafeData() ) { // Test existence of the second object
145  return true; // Fine: Both objects exist
146  }
147  }
148  return false; // Tough luck: One is missing.
149 }

◆ operator&&() [3/3]

template<class B , class LDB >
bool operator&& ( SmartDataStorePtr< B, LDB > &  object,
bool  test 
)

Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ...

if ( test && mcvertices ) { ... } and tests the existence of BOTH objects in the data store.

Parameters
objectSmart pointer to second object
testSecond boolean to test
Returns
Boolean indicating existence of both objects

Definition at line 182 of file SmartDataStorePtr.h.

182  {
183  if ( test ) { // Test existence of the first object
184  if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
185  return true; // Fine: Both objects exist
186  }
187  }
188  return false; // Tough luck: One is missing.
189 }

◆ operator||() [1/3]

template<class B , class LDB >
bool operator|| ( bool  test,
SmartDataStorePtr< B, LDB > &  object 
)

Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ...

if ( test || mcvertices ) { ... } and tests the existence of BOTH objects in the data store.

Parameters
testFirst boolean to test
objectSmart pointer to second object
Returns
Boolean indicating existence of both objects

Definition at line 227 of file SmartDataStorePtr.h.

227  {
228  if ( test ) { // Test existence of the first object
229  return true;
230  }
231  if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
232  return true; // Fine: Both objects exist
233  }
234  return false; // Tough luck: One is missing.
235 }

◆ operator||() [2/3]

template<class A , class LDA , class B , class LDB >
bool operator|| ( SmartDataStorePtr< A, LDA > &  object_1,
SmartDataStorePtr< B, LDB > &  object_2 
)

Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); SmartDataPtr<MCParticleVector> mctracks (evt,"/MC/MCParticles"); if ( mctracks || mcvertices ) { ...

} and tests the existence of at least one objects in the data store. The second object will then NOT be loaded. It is assumed that the second choice is only an alternative usable in case the first object cannot be retrieved.

Parameters
object_1Smart pointer to object 1
object_2Smart pointer to second object
Returns
Boolean indicating existence of both objects

Definition at line 206 of file SmartDataStorePtr.h.

206  {
207  if ( 0 != object_1.accessTypeSafeData() ) { // Test existence of the first object
208  return true;
209  }
210  if ( 0 != object_2.accessTypeSafeData() ) { // Test existence of the second object
211  return true;
212  }
213  return false; // Tough luck: Both are missing.
214 }

◆ operator||() [3/3]

template<class B , class LDB >
bool operator|| ( SmartDataStorePtr< B, LDB > &  object,
bool  test 
)

Helper to test Smart data objects efficiently This construct allows statements like: SmartDataPtr<MCVertexVector> mcvertices (evt,"/MC/MCVertices"); bool test = ...

if ( test && mcvertices ) { ... } and tests the existence of BOTH objects in the data store.

Parameters
objectSmart pointer to second object
testSecond boolean to test
Returns
Boolean indicating existence of both objects

Definition at line 248 of file SmartDataStorePtr.h.

248  {
249  if ( test ) { // Test existence of the first object
250  return true;
251  }
252  if ( 0 != object.accessTypeSafeData() ) { // Test existence of the second object
253  return true; // Fine: Both objects exist
254  }
255  return false; // Tough luck: One is missing.
256 }
SmartDataStorePtr::accessTypeSafeData
TYPE * accessTypeSafeData()
Internal type safe accessor to data.
Definition: SmartDataStorePtr.h:121
compareRootHistos.test
test
Definition: compareRootHistos.py:28