32 #include "TEveManager.h"
33 #include "TEveEventManager.h"
34 #include "TEveTrackPropagator.h"
35 #include "TGLWidget.h"
37 #include "TEveBrowser.h"
41 class CmsEveMagField :
public TEveMagField
49 CmsEveMagField() : TEveMagField(), fField(-3.8), fFieldMag(3.8) {}
50 virtual ~CmsEveMagField() {}
53 void SetFieldByCurrent(Float_t avg_current)
55 fField = -3.8 * avg_current / 18160.0;
56 fFieldMag = TMath::Abs(fField);
60 virtual Float_t GetMaxFieldMag()
const
65 virtual TEveVector GetField(Float_t
x, Float_t
y, Float_t
z)
const
67 static const Float_t barrelFac = 1.2 / 3.8;
68 static const Float_t endcapFac = 2.0 / 3.8;
70 const Float_t
R =
sqrt(x*x+y*y);
71 const Float_t absZ = TMath::Abs(z);
77 if (R < 300.0
f)
return TEveVector(0, 0, fField);
80 if ((R > 461.0
f && R < 490.5
f) ||
81 (R > 534.5
f && R < 597.5
f) ||
82 (R > 637.0
f && R < 700.0
f))
84 return TEveVector(0, 0, -fField*barrelFac);
87 if ((absZ > 724.0
f && absZ < 786.0
f) ||
88 (absZ > 850.0
f && absZ < 910.0
f) ||
89 (absZ > 975.0
f && absZ < 1003.0
f))
91 const Float_t fac = (z >= 0 ? fField : -fField) * endcapFac / R;
92 return TEveVector(x*fac, y*fac, 0);
95 return TEveVector(0, 0, 0);
116 m_context(new fireworks::
Context(changeManager(),
120 m_metadataManager.
get())),
122 m_Rint(m_appHelper.app()),
127 printf(
"FWFFService::FWFFService CTOR\n");
137 const char *releaseBase = getenv(
"CMSSW_RELEASE_BASE");
138 const char *workarea = getenv(
"CMSSW_BASE");
139 std::string displayConfigRelFilename =
"/src/Fireworks/FWInterface/macros/ffw.fwc";
140 std::string geometryRelFilename =
"/src/Fireworks/FWInterface/data/cmsGeom10.root";
142 std::string displayConfigFilename =
"ffw.fwc";
145 if (releaseBase && access((releaseBase + displayConfigFilename).c_str(), R_OK) == 0)
146 displayConfigFilename = releaseBase + displayConfigRelFilename;
147 if (workarea && access((workarea + displayConfigRelFilename).c_str(), R_OK) == 0)
148 displayConfigFilename = workarea + displayConfigRelFilename;
150 if (releaseBase && access((releaseBase + geometryRelFilename).c_str(), R_OK) == 0)
151 geometryFilename = releaseBase + geometryRelFilename;
152 if (workarea && access((workarea + geometryRelFilename).c_str(), R_OK) == 0)
153 geometryFilename = workarea + geometryRelFilename;
155 displayConfigFilename = ps.
getUntrackedParameter<std::string>(
"diplayConfigFilename", displayConfigFilename);
163 if (!geometryFilename.empty())
183 printf(
"FWFFService::~FWFFService DTOR\n");
196 printf(
"FWFFService::postBeginJob\n");
202 f=boost::bind(&TApplication::Terminate,
m_Rint, 0);
208 gSystem->ProcessEvents();
214 printf(
"FWFFService::postEndJob\n");
216 TEveManager::Terminate();
234 if (!
guiManager()->playEventsAction()->isEnabled())
272 bool res = iRun.
getByLabel(
"conditionsInEdm", runCond);
275 printf(
"Got current from conds in edm %f\n", runCond->BAvgCurrent);
276 current = runCond->BAvgCurrent;
280 printf(
"Could not extract run-conditions get-result=%d, is-valid=%d\n", res, runCond.
isValid());
285 current = sum->m_avg_current;
286 printf(
"Got current from RunInfoRcd %f\n", sum->m_avg_current);
289 static_cast<CmsEveMagField*
>(
m_MagField)->SetFieldByCurrent(current);
296 printf(
"FWFFService::postProcessEvent: Starting GUI loop.\n");
340 printf(
"FWFFService exiting on user request.\n");
void watchPostBeginRun(PostBeginRun::slot_type const &iSlot)
bool getByLabel(std::string const &label, Handle< PROD > &result) const
T getUntrackedParameter(std::string const &, T const &) const
std::auto_ptr< FWFFNavigator > m_navigator
FWGUIManager * guiManager()
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void initMap(const FWRecoGeom::InfoMap &map)
FWFFService(const edm::ParameterSet &, edm::ActivityRegistry &)
void postProcessEvent(const edm::Event &, const edm::EventSetup &)
FWEventItemsManager * eiManager()
void postBeginRun(const edm::Run &, const edm::EventSetup &)
void setup(FWNavigatorBase *navigator, fireworks::Context *context, FWJobMetadataManager *metadataManager)
void updateStatus(const char *status)
void setContext(fireworks::Context *)
void enableNavigatorControls()
void setGeometryFilename(const std::string &filename)
void setupFieldForPropagator(TEveTrackPropagator *prop)
void watchPostProcessEvent(PostProcessEvent::slot_type const &iSlot)
CmsShowTaskExecutor * startupTasks()
void setupConfiguration()
CmsShowMainFrame * getMainFrame() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
TEveMagField * getMagField()
TEveMagField * m_MagField
T const * product() const
CSGContinuousAction * playEventsAction()
std::auto_ptr< FWFFMetadataManager > m_metadataManager
void display(const std::string &info="")
boost::function0< void > TaskFunctor
void addTask(const TaskFunctor &iTask)
std::auto_ptr< fireworks::Context > m_context
const std::string & geometryFilename(void)
void setConfigFilename(const std::string &f)
virtual void checkPosition()
T get(const Candidate &c)
void watchPostBeginJob(PostBeginJob::slot_type const &iSlot)
convenience function for attaching to signal