CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
DDG4ProductionCuts.cc File Reference
#include "SimG4Core/Physics/interface/DDG4ProductionCuts.h"
#include "SimG4Core/Notification/interface/SimG4Exception.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "G4ProductionCuts.hh"
#include "G4RegionStore.hh"
#include <algorithm>

Go to the source code of this file.

Functions

bool dd_is_greater (const std::pair< G4LogicalVolume *, DDLogicalPart > &p1, const std::pair< G4LogicalVolume *, DDLogicalPart > &p2)
 

Function Documentation

bool dd_is_greater ( const std::pair< G4LogicalVolume *, DDLogicalPart > &  p1,
const std::pair< G4LogicalVolume *, DDLogicalPart > &  p2 
)

helper function to compare parts through their name instead of comparing them by their pointers. It's guaranteed to produce the same order in subsequent application runs, while pointers usually can't guarantee this

Definition at line 25 of file DDG4ProductionCuts.cc.

References query::result.

Referenced by DDG4ProductionCuts::initialize().

26  {
27  bool result = false;
28  if (p1.second.name().ns() > p2.second.name().ns()) {
29  result = true;
30  }
31  if (p1.second.name().ns() == p2.second.name().ns()) {
32  if (p1.second.name().name() > p2.second.name().name()) {
33  result = true;
34  }
35  if (p1.second.name().name() == p2.second.name().name()) {
36  if (p1.first->GetName() > p2.first->GetName()) {
37  result = true;
38  }
39  }
40  }
41  return result;
42 }
tuple result
Definition: query.py:137
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89