Skip to content

Commit

Permalink
Merge pull request #1343 from alja/addcollectionFF
Browse files Browse the repository at this point in the history
Fireworks -- TrackingParticle visualization improvements.
  • Loading branch information
ktf committed Nov 6, 2013
2 parents d0183f3 + 171fd82 commit fedb5f4
Show file tree
Hide file tree
Showing 17 changed files with 316 additions and 229 deletions.
3 changes: 2 additions & 1 deletion Fireworks/Core/interface/FWEDProductRepresentationChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class FWEDProductRepresentationChecker : public FWRepresentationCheckerBase {
FWEDProductRepresentationChecker(const std::string& iTypeidName,
const std::string& iPurpose,
unsigned int iBitPackedViews,
bool iRepresentsSubPart);
bool iRepresentsSubPart,
bool iRequiresFF = false);

// ---------- const member functions ---------------------
virtual FWRepresentationInfo infoFor(const std::string& iTypeName) const;
Expand Down
6 changes: 3 additions & 3 deletions Fireworks/Core/interface/FWGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class FWGeometry
// get reco topology/parameters
const float* getParameters( unsigned int id ) const;

void localToGlobal( unsigned int id, const float* local, float* global ) const;
void localToGlobal( unsigned int id, const float* local1, float* global1, const float* local2, float* global2 ) const;
void localToGlobal( unsigned int id, const float* local, float* global, bool translatep=true ) const;
void localToGlobal( unsigned int id, const float* local1, float* global1, const float* local2, float* global2, bool translatep=true ) const;

struct GeomDetInfo
{
Expand Down Expand Up @@ -101,7 +101,7 @@ class FWGeometry

void clear( void ) { m_idToInfo.clear(); m_idToMatrix.clear(); }
IdToInfoItr find( unsigned int ) const;
void localToGlobal( const GeomDetInfo& info, const float* local, float* global ) const;
void localToGlobal( const GeomDetInfo& info, const float* local, float* global, bool translatep=true ) const;

private:
mutable std::map<unsigned int, TGeoMatrix*> m_idToMatrix;
Expand Down
5 changes: 4 additions & 1 deletion Fireworks/Core/interface/FWRepresentationCheckerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FWRepresentationInfo;
class FWRepresentationCheckerBase {

public:
FWRepresentationCheckerBase(const std::string& iPurpose, unsigned int iBitPackedViews, bool iRepresentsSubPart);
FWRepresentationCheckerBase(const std::string& iPurpose, unsigned int iBitPackedViews, bool iRepresentsSubPart, bool iRequiresFF = false);
virtual ~FWRepresentationCheckerBase();

// ---------- const member functions ---------------------
Expand All @@ -38,6 +38,8 @@ class FWRepresentationCheckerBase {

unsigned int bitPackedViews() const;
bool representsSubPart() const;

bool requiresFF() const { return m_requiresFF; }
// ---------- static member functions --------------------

// ---------- member functions ---------------------------
Expand All @@ -51,6 +53,7 @@ class FWRepresentationCheckerBase {
const std::string m_purpose;
const unsigned int m_bitPackedViews;
const bool m_representsSubPart;
const bool m_requiresFF;

};

Expand Down
13 changes: 9 additions & 4 deletions Fireworks/Core/interface/FWRepresentationInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,19 @@
class FWRepresentationInfo {

public:
FWRepresentationInfo(const std::string& iPurpose, unsigned int iProximity, unsigned int iBitPackedViews, bool iRepresentsSubPart) :
FWRepresentationInfo(const std::string& iPurpose, unsigned int iProximity, unsigned int iBitPackedViews, bool iRepresentsSubPart, bool iRequiresFF) :
m_purpose(iPurpose),
m_proximity(iProximity),
m_bitPackedViews(iBitPackedViews),
m_representsSubPart(iRepresentsSubPart){
m_representsSubPart(iRepresentsSubPart)
{
}
FWRepresentationInfo() :
m_purpose(),
m_proximity(0xFFFFFFFF),
m_bitPackedViews(0),
m_representsSubPart(false) {
m_representsSubPart(false),
m_requiresFF(false){
}
//virtual ~FWRepresentationInfo();

Expand All @@ -57,6 +59,8 @@ class FWRepresentationInfo {
bool representsSubPart() const {
return m_representsSubPart;
}

bool requiresFF() const { return m_requiresFF; }

unsigned int bitPackedViews() const {
return m_bitPackedViews;
Expand All @@ -74,8 +78,9 @@ class FWRepresentationInfo {
std::string m_purpose;
unsigned int m_proximity;
unsigned int m_bitPackedViews;
bool m_representsSubPart;

bool m_representsSubPart;
bool m_requiresFF;
};


Expand Down
3 changes: 2 additions & 1 deletion Fireworks/Core/interface/FWSimpleRepresentationChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class FWSimpleRepresentationChecker : public FWRepresentationCheckerBase {
FWSimpleRepresentationChecker(const std::string& iTypeidName,
const std::string& iPurpose,
unsigned int iBitPackedViews,
bool iRepresentsSubPart);
bool iRepresentsSubPart,
bool iRequiresFF = false);
virtual ~FWSimpleRepresentationChecker();

// ---------- const member functions ---------------------
Expand Down
7 changes: 4 additions & 3 deletions Fireworks/Core/src/FWEDProductRepresentationChecker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
FWEDProductRepresentationChecker::FWEDProductRepresentationChecker(const std::string& iTypeidName,
const std::string& iPurpose,
unsigned int iBitPackedViews,
bool iRepresentsSubPart) :
FWRepresentationCheckerBase(iPurpose, iBitPackedViews,iRepresentsSubPart),
bool iRepresentsSubPart,
bool iRequiresFF) :
FWRepresentationCheckerBase(iPurpose,iBitPackedViews,iRepresentsSubPart, iRequiresFF),
m_typeidName(iTypeidName)
{
}
Expand Down Expand Up @@ -73,7 +74,7 @@ FWEDProductRepresentationChecker::infoFor(const std::string& iTypeName) const
return FWRepresentationInfo();
}
if(clss->GetTypeInfo()->name() == m_typeidName) {
return FWRepresentationInfo(purpose(),0,bitPackedViews(), representsSubPart());
return FWRepresentationInfo(purpose(),0,bitPackedViews(), representsSubPart(), requiresFF());
}
return FWRepresentationInfo();
}
Expand Down
9 changes: 6 additions & 3 deletions Fireworks/Core/src/FWEveViewManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ FWEveViewManager::supportedTypesAndRepresentations() const
// needed for add collection GUI
FWTypeToRepresentations returnValue;
const std::string kSimple("simple#");
const static std::string kFullFrameWorkPBExtension = "FullFramework";
for(TypeToBuilder::const_iterator it = m_typeToBuilder.begin(), itEnd = m_typeToBuilder.end();
it != itEnd;
++it)
Expand All @@ -688,18 +689,20 @@ FWEveViewManager::supportedTypesAndRepresentations() const
{
BuilderInfo &info = blist[bii];
std::string name = info.m_name;

unsigned int bitPackedViews = info.m_viewBit;
bool representsSubPart = (name.substr(name.find_first_of('@')-1, 1)=="!");

size_t extp = name.rfind(kFullFrameWorkPBExtension);
bool FFOnly = (extp != std::string::npos);
if(name.substr(0,kSimple.size()) == kSimple)
{
name = name.substr(kSimple.size(), name.find_first_of('@')-kSimple.size()-1);
returnValue.add(boost::shared_ptr<FWRepresentationCheckerBase>(new FWSimpleRepresentationChecker(name, it->first,bitPackedViews,representsSubPart)) );
returnValue.add(boost::shared_ptr<FWRepresentationCheckerBase>(new FWSimpleRepresentationChecker(name, it->first,bitPackedViews,representsSubPart, FFOnly)) );
}
else
{
name = name.substr(0, name.find_first_of('@')-1);
returnValue.add(boost::shared_ptr<FWRepresentationCheckerBase>(new FWEDProductRepresentationChecker(name, it->first,bitPackedViews,representsSubPart)) );
returnValue.add(boost::shared_ptr<FWRepresentationCheckerBase>(new FWEDProductRepresentationChecker(name, it->first,bitPackedViews,representsSubPart, FFOnly)) );
}
}
}
Expand Down
21 changes: 11 additions & 10 deletions Fireworks/Core/src/FWGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ FWGeometry::getShapePars( unsigned int id ) const
}

void
FWGeometry::localToGlobal( unsigned int id, const float* local, float* global ) const
FWGeometry::localToGlobal( unsigned int id, const float* local, float* global, bool translatep ) const
{
IdToInfoItr it = FWGeometry::find( id );
if( it == m_idToInfo.end())
Expand All @@ -331,12 +331,13 @@ FWGeometry::localToGlobal( unsigned int id, const float* local, float* global )
}
else
{
localToGlobal( *it, local, global );
localToGlobal( *it, local, global, translatep );
}
}

void
FWGeometry::localToGlobal( unsigned int id, const float* local1, float* global1, const float* local2, float* global2 ) const
FWGeometry::localToGlobal( unsigned int id, const float* local1, float* global1,
const float* local2, float* global2, bool translatep ) const
{
IdToInfoItr it = FWGeometry::find( id );
if( it == m_idToInfo.end())
Expand All @@ -345,8 +346,8 @@ FWGeometry::localToGlobal( unsigned int id, const float* local1, float* global1,
}
else
{
localToGlobal( *it, local1, global1 );
localToGlobal( *it, local2, global2 );
localToGlobal( *it, local1, global1, translatep );
localToGlobal( *it, local2, global2, translatep );
}
}

Expand All @@ -359,13 +360,13 @@ FWGeometry::find( unsigned int id ) const
}

void
FWGeometry::localToGlobal( const GeomDetInfo& info, const float* local, float* global ) const
FWGeometry::localToGlobal( const GeomDetInfo& info, const float* local, float* global, bool translatep ) const
{
for( int i = 0; i < 3; ++i )
{
global[i] = info.translation[i]
+ local[0] * info.matrix[3 * i]
+ local[1] * info.matrix[3 * i + 1]
+ local[2] * info.matrix[3 * i + 2];
global[i] = translatep ? info.translation[i] : 0;
global[i] += local[0] * info.matrix[3 * i]
+ local[1] * info.matrix[3 * i + 1]
+ local[2] * info.matrix[3 * i + 2];
}
}
4 changes: 3 additions & 1 deletion Fireworks/Core/src/FWLiteJobMetadataManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ FWLiteJobMetadataManager::doUpdate(FWJobMetadataUpdateRequest *request)
/* if(!infos[ii].representsSubPart() && minProx != infos[ii].proximity()) {
continue;
} */
purposes.insert(infos[ii].purpose());
if (infos[ii].requiresFF() == false) {
purposes.insert(infos[ii].purpose());
}
}

if (purposes.empty())
Expand Down
5 changes: 3 additions & 2 deletions Fireworks/Core/src/FWRepresentationCheckerBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
//
FWRepresentationCheckerBase::FWRepresentationCheckerBase(const std::string& iPurpose,
unsigned int iBitPackedViews,
bool iRepresentsSubPart) :
m_purpose(iPurpose), m_bitPackedViews(iBitPackedViews), m_representsSubPart(iRepresentsSubPart)
bool iRepresentsSubPart,
bool iRequiresFF) :
m_purpose(iPurpose), m_bitPackedViews(iBitPackedViews), m_representsSubPart(iRepresentsSubPart), m_requiresFF(iRequiresFF)
{
}

Expand Down
7 changes: 4 additions & 3 deletions Fireworks/Core/src/FWSimpleRepresentationChecker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
FWSimpleRepresentationChecker::FWSimpleRepresentationChecker(const std::string& iTypeName,
const std::string& iPurpose,
unsigned int iBitPackedViews,
bool iRepresentsSubPart) :
FWRepresentationCheckerBase(iPurpose,iBitPackedViews,iRepresentsSubPart),
bool iRepresentsSubPart,
bool iRequiresFF) :
FWRepresentationCheckerBase(iPurpose,iBitPackedViews,iRepresentsSubPart, iRequiresFF),
m_typeidName(iTypeName)
{
}
Expand Down Expand Up @@ -117,7 +118,7 @@ FWSimpleRepresentationChecker::infoFor(const std::string& iTypeName) const
//see if the modelType inherits from our type

if(inheritsFrom(modelType,m_typeidName,distance) ) {
return FWRepresentationInfo(purpose(),distance,bitPackedViews(), representsSubPart());
return FWRepresentationInfo(purpose(),distance,bitPackedViews(), representsSubPart(), requiresFF());
}
return FWRepresentationInfo();
}
Expand Down
9 changes: 5 additions & 4 deletions Fireworks/Core/src/FWTypeToRepresentations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,15 @@ FWTypeToRepresentations::representationsForType(const std::string& iTypeName) co
std::vector<FWRepresentationInfo> reps;
//check all reps
for(std::vector<boost::shared_ptr<FWRepresentationCheckerBase> >::const_iterator it = m_checkers.begin(),
itEnd = m_checkers.end();
itEnd = m_checkers.end();
it != itEnd;
++it) {
FWRepresentationInfo info = (*it)->infoFor(iTypeName);
if(info.isValid()) {

FWRepresentationInfo info = (*it)->infoFor(iTypeName);
if(info.isValid())
reps.push_back(info);
}
}

m_typeToReps.insert(std::make_pair(iTypeName,reps));
itFound = m_typeToReps.find(iTypeName);
}
Expand Down

0 comments on commit fedb5f4

Please sign in to comment.