Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to color reconstructed particles by energy #9

Merged
merged 3 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ced2go/ced2go-template-DD4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,22 @@
<parameter name="DrawHelixForPFOs" type="int">0 </parameter>
<!--draw a helix for Track objects: -1: none, 0: default, 1: atIP, 2: atFirstHit, 3: atLastHit, 4: atCalorimeter-->
<parameter name="DrawHelixForTrack" type="int">0 </parameter>
<!-- Color recunstructed particle by energy -->
<parameter name="ColorByEnergy" type="bool">false</parameter>
<!-- Minimal value for energy which will be represented as blue -->
<parameter name="ColorByEnergyMin" type="double">0.0</parameter>
<!-- Maximal value for energy which will be represented as red -->
<parameter name="ColorByEnergyMax" type="double">35.0</parameter>
<!-- Hue value that will be used to determine the pallete -->
<parameter name="ColorByEnergySaturation" type="double">1.0</parameter>
<!-- Brigtness value that will be used to determine the pallete -->
<parameter name="ColorByEnergyBrightness" type="double">1.0</parameter>
<!-- Automatically adjust event by event the blue to min energy and red to max energy of event -->
<parameter name="ColorByEnergyAutoColor" type="bool">false</parameter>
<!-- Scale line thickness of drawn helixes, usefull for image dumps -->
<parameter name="ScaleLineThickness" type="double">1</parameter>
<!-- Scale marker size of cluster markers, usefull for image dumps -->
<parameter name="ScaleMarkerSize" type="double">1</parameter>
<!--Max R (mm) Extent for drawing Helix if UseTPCForLimitsOfHelix false-->
<parameter name="HelixMaxR" type="float">2000 </parameter>
<!--Max Z (mm) Extent for drawing Helix if UseTPCForLimitsOfHelix false-->
Expand Down
16 changes: 16 additions & 0 deletions ced2go/ced2go-template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,22 @@ $LCIOInputFiles$
<parameter name="DrawDetectorID" type="int">0 </parameter>
<!--draw a helix for PFO objects (usefull for Si tracker): 0: disabled, 1: enabled-->
<parameter name="DrawHelixForPFOs" type="int">0 </parameter>
<!-- Color recunstructed particle by energy -->
<parameter name="ColorByEnergy" type="bool">false</parameter>
<!-- Minimal value for energy which will be represented as blue -->
<parameter name="ColorByEnergyMin" type="double">0.0</parameter>
<!-- Maximal value for energy which will be represented as red -->
<parameter name="ColorByEnergyMax" type="double">35.0</parameter>
<!-- Hue value that will be used to determine the pallete -->
<parameter name="ColorByEnergySaturation" type="double">1.0</parameter>
<!-- Brigtness value that will be used to determine the pallete -->
<parameter name="ColorByEnergyBrightness" type="double">1.0</parameter>
<!-- Automatically adjust event by event the blue to min energy and red to max energy of event -->
<parameter name="ColorByEnergyAutoColor" type="bool">false</parameter>
<!-- Scale line thickness of drawn helixes, usefull for image dumps -->
<parameter name="ScaleLineThickness" type="double">1</parameter>
<!-- Scale marker size of cluster markers, usefull for image dumps -->
<parameter name="ScaleMarkerSize" type="double">1</parameter>
<!--draw a helix for Track objects: -1: none, 0: default, 1: atIP, 2: atFirstHit, 3: atLastHit, 4: atCalorimeter-->
<parameter name="DrawHelixForTrack" type="int">0 </parameter>
<!--Max R (mm) Extent for drawing Helix if UseTPCForLimitsOfHelix false-->
Expand Down
40 changes: 24 additions & 16 deletions include/CEDViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,34 @@ class CEDViewer : public Processor {

/** Input collection name.
*/
StringVec _drawCollections ;
StringVec _drawCollectionsLayer ;
StringVec _drawCollections {};
StringVec _drawCollectionsLayer {};

bool _usingParticleGun ;
int _drawHelixForTracks ;
int _drawDetectorID ;
int _colorScheme ;
float _mcpECut ;
bool _usingParticleGun = false ;
int _drawHelixForTracks = 0 ;
bool _colorEnergy = false ;
double _colorEnergyMin = 0.0 ;
double _colorEnergyMax = 35.0 ;
double _colorEnergySaturation = 0.8 ;
double _colorEnergyValue = 0.8 ;
bool _colorEnergyAuto = false ;
double _scaleLineThickness = 1 ;
double _scaleMarkerSize = 1 ;
int _drawDetectorID = 0 ;
int _colorScheme = 10;
float _mcpECut = 0.001;

float _helix_max_r;
float _helix_max_z;
bool _useTPCForLimitsOfHelix;
int _waitForKeyboard ;
int _drawHelixForPFOs;
int _useColorForHelixTracks ;
IntVec _colors ;
float _helix_max_r = 2000 ;
float _helix_max_z = 2500 ;
bool _useTPCForLimitsOfHelix = false ;
int _waitForKeyboard = 1 ;
int _drawHelixForPFOs = 0 ;
int _useColorForHelixTracks = 0;
IntVec _colors {};


int _nRun ;
int _nEvt ;
int _nRun = 0 ;
int _nEvt = 0 ;
} ;

#endif
Expand Down
16 changes: 16 additions & 0 deletions include/ColorMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@

typedef void (*colorMapFunc)(unsigned int*,float,float,float);

typedef struct RgbColor
{
double r;
double g;
double b;
} RgbColor;

typedef struct HsvColor
{
double h;
double s;
double v;
} HsvColor;

class ColorMap{
public:
static void colorMap(unsigned int *rgb,float value,float min,float max);
Expand All @@ -24,6 +38,8 @@ class ColorMap{
static void blueColorMap(unsigned int *rgb,float value,float min,float max);
static colorMapFunc selectColorMap(int cmp);
static int RGB2HEX(int red, int green, int blue);
static RgbColor HsvToRgb(HsvColor in);
static unsigned long NumberToTemperature(double value, double min, double max, double s, double v);
};

#endif
50 changes: 29 additions & 21 deletions include/DDCEDViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,32 +113,40 @@ class DDCEDViewer : public Processor {
static const int Light = 11 ;
static const int Classic = 12 ;

StringVec _drawCollections ;
StringVec _drawCollectionsLayer ;
std::vector< DrawParameters > drawParameters ;
StringVec _drawCollections{} ;
StringVec _drawCollectionsLayer{} ;
std::vector< DrawParameters > drawParameters{} ;

//general options
int _nRun ;
int _nEvt ;
int _nRun = 0 ;
int _nEvt = 0;
//lcio options
bool _usingParticleGun ;
int _drawHelixForTracks ;
int _colorScheme ;
float _mcpECut ;
float _helix_max_r;
float _helix_max_z;
bool _useTrackerForLimitsOfHelix;
int _waitForKeyboard ;
int _drawHelixForPFOs;
int _useColorForHelixTracks ;
int _drawEllipsoidForPFOClusters ;
IntVec _colors ;
bool _usingParticleGun = false ;
int _drawHelixForTracks = 0 ;
int _colorScheme = 10 ;
bool _colorEnergy = false ;
double _colorEnergyMin = 0.0 ;
double _colorEnergyMax = 35.0 ;
double _colorEnergySaturation = 0.8 ;
double _colorEnergyValue = 0.8 ;
bool _colorEnergyAuto = false ;
double _scaleLineThickness = 1 ;
double _scaleMarkerSize = 1 ;
float _mcpECut = 0.001 ;
float _helix_max_r = 2000 ;
float _helix_max_z = 2500 ;
bool _useTrackerForLimitsOfHelix = true ;
int _waitForKeyboard = 1 ;
int _drawHelixForPFOs = 0 ;
int _useColorForHelixTracks = 0 ;
int _drawEllipsoidForPFOClusters = 0 ;
IntVec _colors{} ;

//detector options
bool _begin;
StringVec _detailled;
StringVec _jets;
bool _surfaces;
bool _begin = false;
StringVec _detailled{};
StringVec _jets{};
bool _surfaces = false;
} ;


Expand Down
Loading